Hello,
I get a random error on my published face (reported by ERA).
An Unexpected Type Error that I don't understand...
Here is an extract of my code:
// View.mc class View extends Ui.WatchFace { private var burn as Boolean; private var aod as Boolean; private var dr as Drawer; function initialize() { WatchFace.initialize(); aod = false; burn = false; } function onLayout(dc as Dc) as Void { dr = new Drawer(dc); burn = System.getDeviceSettings() has :requiresBurnInProtection and System.getDeviceSettings().requiresBurnInProtection; } function onEnterSleep() as Void { aod = true; dr.setSleepMode(aod and burn); // <-- Unexpected Type Error on this line Ui.requestUpdate(); } } // Drawer.mc class Drawer { private var _dc as Dc; private var _sleepMode as Boolean; function initialize(dc as Dc) { _dc = dc; _sleepMode = false; } function setSleepMode(sleepMode as Boolean) as Void { _sleepMode = sleepMode; } }
Can you see what is going on? Could the variable burn become null at some point?