Closed warmsound closed 3 years ago
getProperty()
may be returning null
, or unexpected type, similar to #123.
Similar ERA error:
Error Name: Unhandled Exception
Occurrences: 108
First Occurrence: 2020-12-11
Last Occurrence: 2020-12-31
Devices:
fēnix® 6 / 6 Solar / 6 Dual Power: 10.10
Forerunner® 245: 5.00, 4.10, 4.00, 3.10, 4.40
vívoactive® 3: 7.40, 7.50
App Versions: 2.4.3
Languages: chs, deu, eng, jpn, kor, pol, tha, vie
Backtrace:
CrystalView.updateThemeColours:194
CrystalView.onSettingsChanged:168
CrystalApp.onSettingsChanged:52
CrystalApp.getInitialView:38
Fix by implementing safe int getter, getIntProperty(key, defaultValue)
, inspired by readKeyInt()
.
Should also fix several others, including:
Error Name: Unexpected Type Error
Occurrences: 24
First Occurrence: 2020-12-11
Last Occurrence: 2020-12-30
Devices:
Venu™: 5.10
App Versions: 2.4.3
Languages: eng, ita, pol
Backtrace:
DataFields.update:121
DataFields.update:121
DataFields.update:113
DataFields.draw:99
Rez.AlwaysOn:60
Rez.AlwaysOn:60
CrystalView.onUpdate:310
Error Name: Array Out Of Bounds Error
Occurrences: 12
First Occurrence: 2020-12-16
Last Occurrence: 2021-01-01
Devices:
vívoactive® 3: 7.40
App Versions: 2.4.3
Languages: eng, spa
Backtrace:
DataFields.onSettingsChanged:88
DataFields.initialize:65
Rez.WatchFace:33
CrystalView.onLayout:126
Reopening, as original issue still occurring on 2.4.4, 1081 occurrences as of 12 Jan.
This suggests that the data type returned by getProperty()
may not be the problem, but rather the value. The only possible settings values are 0, 1 and 2, so a rogue value must be creeping in somehow. We probably need a try...catch
here that uses a default 0 value if an exception occurs.
There's a much smaller number of exceptions (6 as of writing) triggered by the following line that gets the MinutesColourOverride
value.