Skip to content

java.lang.NullPointerException on Color Coordinator #11

@diablodale

Description

@diablodale

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
3835dcc#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions