hepcat72 / node-red-contrib-life360

GNU General Public License v3.0
3 stars 4 forks source link

TypeError: Cannot read property 'name' of null #13

Open hepcat72 opened 2 years ago

hepcat72 commented 2 years ago
TypeError: Cannot read property 'name' of null
    at ServerNode.sendChanged (/home/pi/.node-red/node_modules/node-red-contrib-life360/nodes/server.js:115:56)
    at /home/pi/.node-red/node_modules/node-red-contrib-life360/nodes/server.js:241:26
    at /home/pi/.node-red/node_modules/node-red-contrib-life360/nodes/server.js:248:17
    at tryCatcher (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/.node-red/node_modules/node-red-contrib-life360/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:464:21)
    at process.callbackTrampoline (internal/async_hooks.js:130:17)
error_status_life360

Errors referencing the config node were in the debug panel/

hepcat72 commented 2 years ago

These first show up in my logs in October of 2021. Not entirely sure why they suddenly started appearing, but they are ballooning my error log to 311Mb.

hepcat72 commented 2 years ago

Implemented a simple fix to initially set locationName and locationSourceId to null and if member.location is not null, I set their values.

I think that Name and SourceId should be null if the person is not at a named location or their location is unknown.

I hope that's correct, because I think that if a user's location is unknown, it doesn't change their current named location if that's the last place they were known to be.

If instead, their unknown location changes their previously known/named location, this could cause unintended arrivals. I'll keep an eye on my new code for awhile to see if that happens.