Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop adapter crashing while publishing Life360 circles. #49

Merged
merged 2 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Feel free to modify the default timespan of 60 seconds for the polling interval.

## Changelog
### 0.2.17 (2021-10-13)
* news
* (PeterVoronov) Fix for issue #41: Fix for error in publishCirclePlaces "Cannot read property 'val' of null


### 0.2.16 (2021-07-12)
Expand Down
20 changes: 10 additions & 10 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"version": "0.2.17",
"news": {
"0.2.17": {
"en": "news",
"de": "neues",
"ru": "новое",
"pt": "novidades",
"nl": "nieuws",
"fr": "nouvelles",
"it": "notizie",
"es": "noticias",
"pl": "nowości",
"zh-cn": ""
"en": "Fix for issue #41: Fix for error in publishCirclePlaces \"Cannot read property 'val' of null\"",
"de": "Fix für Problem Nr. 41: Fix für den Fehler in publishCirclePlaces \"Cannot read property 'val' of null\"",
"ru": "Исправление проблемы №41: Исправление ошибки в publishCirclePlaces «Невозможно прочитать свойство 'val', равное нулю»",
"pt": "Correção para o problema nº 41: correção para erro em publishCirclePlaces \"Não é possível ler a propriedade 'val' de nulo\"",
"nl": "Oplossing voor probleem 41: Oplossing voor fout in publishCirclePlaces \"Kan eigenschap 'val' van null niet lezen\"",
"fr": "Correction du problème n° 41 : Correction d'une erreur dans publishCirclePlaces \"Impossible de lire la propriété 'val' de null\"",
"it": "Correzione del problema n. 41: correzione dell'errore in publishCirclePlaces \"Impossibile leggere la proprietà 'val' di null\"",
"es": "Arreglo para el problema # 41: Arreglo para el error en publishCirclePlaces \"No se puede leer la propiedad 'val' de null\"",
"pl": "Poprawka dla problemu #41: Naprawiono błąd w publishCirclePlaces „Nie można odczytać właściwości 'val' o wartości null”",
"zh-cn": "修复问题 #41:修复 publishCirclePlaces 中的错误“无法读取 null 的属性‘val’”"
},
"0.2.16": {
"en": "Fix for issue #39: Don't let the adapter crash if the Life360 API returns a server error. \nFix for issue #35: ioBroker complains about writing to a read-only state on adapter startup.",
Expand Down
6 changes: 4 additions & 2 deletions lib/life360DbConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ let process_life360_places = true;
let process_life360_people = true;
let myPlaces = [];
let dirCircles = [];
let cleanupStaleDatapointsAge = 30;
// eslint-disable-next-line prefer-const
let cleanupStaleDatapointsAge = 30; // DEPRECATED. Will be removed in later releases.
let debugging_verbose = false;

/**
Expand All @@ -57,7 +58,7 @@ function logger(level, message) {
* @param {*} longitude
*/
function getGeoLocation(latitude, longitude) {
var geoData = "";
let geoData = "";

switch(location_object_type) {
// Custom formatters for gps-coordinates
Expand Down Expand Up @@ -86,6 +87,7 @@ function getGeoLocation(latitude, longitude) {
*/
function getSantinizedObjectName(orgName) {
// The following characters are not allowed anymore: *?"',;`<>\$
// eslint-disable-next-line no-useless-escape
return orgName.replace(/[\.\*\?\"\'\,\;\`\<\>\\\$]/g, "_");
}

Expand Down
Loading