Fix for crash on null device
This commit is contained in:
1 parent
079255d7bd
commit
71c91766a6
1 file changed
+1
@@ -152,6 +152,7 @@ connectionRequest = (deviceId, callback) ->
|
|||||||
|
|
||||||
db.devicesCollection.findOne({_id : deviceId}, proj, (err, device)->
|
db.devicesCollection.findOne({_id : deviceId}, proj, (err, device)->
|
||||||
return callback(err) if err
|
return callback(err) if err
|
||||||
|
return callback(new Error("No such device")) if !device
|
||||||
|
|
||||||
if device.Device? # TR-181 data model
|
if device.Device? # TR-181 data model
|
||||||
connectionRequestUrl = device.Device.ManagementServer.ConnectionRequestURL._value
|
connectionRequestUrl = device.Device.ManagementServer.ConnectionRequestURL._value
|
||||||
|
|||||||
Reference in new issue
Block a user