Error due to CurrentEventAttribute not 'tile'


#1

1) Give a description of the problem
I’m working with a modification of the Light Switch Status Tiles (code:aupy). My variation’s code is fm0q. For the record, the original also exhibits this problem and it has been brought up in the thread Device Status Tiles but without resolution. I’d like to be able to evaluate whether the CurrentEventAttribute is ‘tile’ before the error thereby preventing it. So far, my own attempts have resulted in failure to execute the Toggle command.

2) What is the expected behavior?
Not generate the error

3) What is happening/not happening?
An error is generated whenever the CurrentEventAttribute is not ‘tile’ The Error: An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
I setup a log to console for CurrentEventAttribute, tile and tilePressDeviceID that generated the following information to support my evaluation of the problem (CurrentEventAttribute is not ‘tile’):

+9729ms ║Piston waited at a semaphore for 9519ms
+10738ms ║switch : 0 : Device ‘Array item index is outside of bounds.’ not found
+10764ms ║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object
11/14/2018, 1:58:21 PM +842ms
+267ms ║tile : 0 : Tree Light
11/14/2018, 1:13:09 PM +735ms
+909ms ║switch : 0 : Device ‘Array item index is outside of bounds.’ not found
+937ms ║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object
11/14/2018, 1:13:09 PM +735ms
+884ms ║switch : 0 : Device ‘Array item index is outside of bounds.’ not found
+912ms ║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object

Edit: include logging of actual tile press where CurrentEventAttribute IS ‘tile’.


Light bulb status tile
#2

I must have been over thinking it since a simple if then seems to have fixed it. Doh!