getting an intermittent error in the logs on user lock manager
ie
a36a-4230-b6a5-022141369d37 1:44:15 PM: error java.lang.NullPointerException: Cannot get property ‘error_loop’ on null object @ line 1249
516380e0-a36a-4230-b6a5-022141369d37 1:42:15 PM: debug state: [lockcbc0f9c4-eece-48a8-a970-fd6bcddb247c:[error_loop:false, codes:[slot6:, slot7:, slot8:, slot9:, slot22:, slot23:, slot20:, slot21:, slot1:1492, slot2:8044, slot3:, slot4:, slot5:, slot19:, slot18:, slot17:, slot16:, slot15:, slot14:, slot13:, slot10:, slot11:, slot30:, slot12:, slot25:, slot24:, slot27:, slot26:, slot29:, slot28:]], lastUser:3, userState3:[enabled:true, usage:1], userState2:[enabled:true, usage:0], userState1:[enabled:true, usage:3], lastLock:7b32978e-df53-49e9-8bf9-efe4440f0c74, error_loop_count:0, lock7b32978e-df53-49e9-8bf9-efe4440f0c74:[error_loop:false, codes:[slot6:, slot7:, slot8:, slot9:, slot22:, slot23:, slot20:, slot1:1492, slot21:, slot2:8044, slot3:, slot4:, slot5:, slot19:, slot18:, slot17:, slot16:, slot15:, slot14:, slot13:, slot10:, slot11:, slot30:, slot12:, slot25:, slot24:, slot27:, slot26:, slot29:, slot28:]]]
516380e0-a36a-4230-b6a5-022141369d37 1:42:15 PM: debug Updating ‘Locks’ with settings: [maxUsers:2, manualUnlock:false, notifyAccessStart:true, sendevent:true, userCode1:1492, notifyAccess:true, dontNotify1:false, userCode3:5296, dontNotify3:false, userHomePhrases3:[I’m Back!], dontNotify2:false, userSlot2:2, phone:6034907476, userSlot3:3, userSlot1:1, burnCode2:false, userEnabled2:true, homePhrases:[I’m Back!], userName1:Master, userEnabled1:true, notifyAccessEnd:false, notification:true, userCode2:8044, userName2:Emergency, userEnabled3:true, burnCode1:false, userHomePhrases1:[I’m Back!], userHomePhrases2:[I’m Back!], userName3:Halonen Landscaping, burnCode3:true, theLocks:[Front Door Lock, Garage Side Door Lock]]
given that what you were trying to do was correct… looking up the lock by number was wrong you needed id I assume when looking at other places you were doing it…
Assuming this to be true here is the fix to the routine…
def allCodesDone() {
def i = 0
def codeComplete = true
/* log old code
theLocks.each { lock->
i++
log.debug "in loop looking at lock:i = $i "
if (state.“lock${i}”.error_loop == true) {
codeComplete = false
}
}
*/
// lgk new code
theLocks.each { lock->
if (state.“lock${lock.id}” != null) {
if (state.“lock${lock.id}”.error_loop == true)
{
codeComplete = false
}
}
}
return codeComplete
}