Simulator crash when passing null options parameter to makeWebRequest
o The Environment:
Windows 10
Eclipse Neon.1 (4.6.1)
ConnectIQ 2.2.3
o A detailed description of the issue
The documentation explicitly says that passing null as the third parameter is allowed. If I do pass null, the simulator crashes with the following error.
Device id 1 name "A garmin device"
Shell Version 0.1.0
Failed invoking <symbol>
Unexpected Type Error
in makeWebRequest (D:\jenkins\workspace\Tech-CIQ-Win-Rel\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\Communications.mb:222)
in onSelect (C:\Users\Travis\workspace\X\source\XApp.mc:24)
in handleEvent (D:\jenkins\workspace\Tech-CIQ-Win-Rel\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:613)
Connection Finished
Closing shell and port
o Steps to reproduce the issue
Compile and run the test case below. Click the simulated device screen or the start button to trigger the web request.
o Any applicable additional information
N/A
o A code sample that can reproduce the issue (in email only if preferred)
using Toybox.Application as App;
using Toybox.Lang as Lang;
using Toybox.System as Sys;
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.Communications as Comm;
class XBehaviorDelegate extends Ui.BehaviorDelegate
{
function initialize() {
BehaviorDelegate.initialize();
}
function onSelect() {
var url = "query.yahooapis.com/.../yql";
var params = {
"q" => "select LastTradePriceOnly from yahoo.finance.quotes where symbol in (\"AMD\")",
//"q" => "select * from yahoo.finance.quotes where symbol in (\"AMD\")",
"format" => "json",
"env" => "store://datatables.org/alltableswithkeys"
};
Comm.makeWebRequest(url, params, null, method(:onQuote));
return true;
}
function onQuote(code, data) {
Sys.println(code);
Sys.println(data);
}
}
class XView extends Ui.View
{
function initialize() {
View.initialize();
}
function onUpdate(dc) {
dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_BLACK);
dc.clear();
}
}
class XApp extends App.AppBase
{
function initialize() {
AppBase.initialize();
}
function getInitialView() {
return [ new XView(), new XBehaviorDelegate() ];
}
}
Travis