hi everyone,
I get a weird SensorHistory issue:
Error: Unexpected Type Error
Details: Failed invoking <symbol>
Exception: UnexpectedTypeException: Expected null/Number, given null
here is my code:
function getIt(w,opt){
var D=null,options = {:period=>opt};
var AMI = [:getHeartRateHistory,:getOxygenSaturationHistory,:getBodyBatteryHistory,:getStressHistory];
if(Toybox has :SensorHistory && SH has AMI[w]){
var gM = new Lang.Method(SH, AMI[w]);
gM = gM.invoke(options);
if(gM!=null){D=gM;}
}
return D;
}
where SH = Toybox.SensorHistory,
the crash happen here: gM = gM.invoke(options);
I also tried gM = gM.invoke({}); with same result.
it is included in a loop and it happens with getOxygenSaturation
The odd thing is that it does not happen on every devices (simulator)
So far I saw this with F6, Enduro and MARQs, but everything is fine with F7 EPIX etc.
Is it an issue known from the simulator or am i missing something?
have a great day.