mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
DVCSMP-1517 Wemo (Connect) SmartApp throws NPE
-Wemo (Connect) SmartApp throws NPE when trying to call subscribe on null object
This commit is contained in:
@@ -341,8 +341,12 @@ def ssdpSwitchHandler(evt) {
|
|||||||
deviceChangedValues = true
|
deviceChangedValues = true
|
||||||
log.debug "Device's port or ip changed..."
|
log.debug "Device's port or ip changed..."
|
||||||
def child = getChildDevice(parsedEvent.mac)
|
def child = getChildDevice(parsedEvent.mac)
|
||||||
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
if (child) {
|
||||||
child.poll()
|
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
||||||
|
child.poll()
|
||||||
|
} else {
|
||||||
|
log.debug "Device with mac $parsedEvent.mac not found"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -410,8 +414,12 @@ def ssdpLightSwitchHandler(evt) {
|
|||||||
deviceChangedValues = true
|
deviceChangedValues = true
|
||||||
log.debug "Device's port or ip changed..."
|
log.debug "Device's port or ip changed..."
|
||||||
def child = getChildDevice(parsedEvent.mac)
|
def child = getChildDevice(parsedEvent.mac)
|
||||||
log.debug "updating ip and port, and resubscribing, for device with mac ${parsedEvent.mac}"
|
if (child) {
|
||||||
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
log.debug "updating ip and port, and resubscribing, for device with mac ${parsedEvent.mac}"
|
||||||
|
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
||||||
|
} else {
|
||||||
|
log.debug "Device with mac $parsedEvent.mac not found"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -463,8 +471,12 @@ def locationHandler(evt) {
|
|||||||
deviceChangedValues = true
|
deviceChangedValues = true
|
||||||
log.debug "Device's port or ip changed..."
|
log.debug "Device's port or ip changed..."
|
||||||
def child = getChildDevice(parsedEvent.mac)
|
def child = getChildDevice(parsedEvent.mac)
|
||||||
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
if (child) {
|
||||||
child.poll()
|
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
||||||
|
child.poll()
|
||||||
|
} else {
|
||||||
|
log.debug "Device with mac $parsedEvent.mac not found"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -518,8 +530,12 @@ def locationHandler(evt) {
|
|||||||
deviceChangedValues = true
|
deviceChangedValues = true
|
||||||
log.debug "Device's port or ip changed..."
|
log.debug "Device's port or ip changed..."
|
||||||
def child = getChildDevice(parsedEvent.mac)
|
def child = getChildDevice(parsedEvent.mac)
|
||||||
log.debug "updating ip and port, and resubscribing, for device with mac ${parsedEvent.mac}"
|
if (child) {
|
||||||
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
log.debug "updating ip and port, and resubscribing, for device with mac ${parsedEvent.mac}"
|
||||||
|
child.subscribe(parsedEvent.ip, parsedEvent.port)
|
||||||
|
} else {
|
||||||
|
log.debug "Device with mac $parsedEvent.mac not found"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user