SmartThings icon indicating copy to clipboard operation
SmartThings copied to clipboard

java.lang.NullPointerException on Color Coordinator

Open diablodale opened this issue 8 years ago • 1 comments

java.lang.NullPointerException: Cannot get property 'id' on null object @ line 36

Repro: Never have installed or run Color coordinator. Choose it from the mobile app for smart apps.

Result: red error at the top of the mobile app: You are not authorized to perform the requested operation using the graph.smartthings website and live logging, you can see the actual error is: java.lang.NullPointerException: Cannot get property 'id' on null object @ line 36

Expected: No error and to see the config UI for Color Coordinator.

This appears to be related to the recent commit https://github.com/MichaelStruck/SmartThings/commit/3835dcca8ef1ca9698bbff7d590ce190c34aa637#diff-d876d2aa4e1acf5dfb8f5f07f2e7c120R36

The line is: def masterInList = slaves.id.find{it==master.id}

If this is the very first time the smartapp is installed/run, then there is no slaves object. The object is null/undefined. Therefore, it is not possible to get the id property on it. And therefore, the java exception occurs.

diablodale avatar Dec 01 '16 16:12 diablodale

Michael, can you lend any help/suggestions for that color coordinator? Thank you!

https://community.smartthings.com/t/cant-choose-color-coordinator-smartapp-in-ide/41311

coreyarb avatar Dec 02 '16 03:12 coreyarb