Skip to content

Commit

Permalink
* (Apollon77) Fix crash case reported by Sentry (fixes IOBROKER-HISTO…
Browse files Browse the repository at this point in the history
…RY-3D)
  • Loading branch information
Apollon77 committed May 27, 2022
1 parent 27f00fc commit f84d337
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ This adapter saves state history in a two-staged process.
-->

## Changelog

### __WORK IN PROGRESS__
* (Apollon77) Fix crash case reported by Sentry

### 2.1.0 (2022-05-27)
* (Apollon77) Fix several crash cases reported by Sentry
* (Apollon77) Make sure disabling "Log changes only" also really do not log the changes anymore
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function storeCached(isFinishing, onlyId) {
}
if (adapter.config.writeNulls) {
const nullValue = {val: null, ts: now, lc: now, q: 0x40, from: 'system.adapter.' + adapter.namespace};
if (history[id][adapter.namespace].changesOnly && history[id].state && history[id].state !== null) {
if (history[id][adapter.namespace] && history[id][adapter.namespace].changesOnly && history[id].state && history[id].state !== null) {
const state = Object.assign({}, history[id].state);
state.ts = now;
state.from = 'system.adapter.' + adapter.namespace;
Expand Down

0 comments on commit f84d337

Please sign in to comment.