From 3a4902ad4ada92fe560c8e54b86f28b39701ecff Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Wed, 13 Feb 2019 23:44:10 +0000 Subject: [PATCH] Fix null dereference in moduleNeedsUpdate when the module isn't visible --- CHANGELOG.md | 1 + js/main.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb8526de..a543e80c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) +- Fix null dereference in moduleNeedsUpdate when the module isn't visible ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). diff --git a/js/main.js b/js/main.js index 7ec9b5f3..21a882f8 100644 --- a/js/main.js +++ b/js/main.js @@ -173,6 +173,10 @@ var MM = (function() { */ var moduleNeedsUpdate = function(module, newHeader, newContent) { var moduleWrapper = document.getElementById(module.identifier); + if (moduleWrapper === null) { + return false; + } + var contentWrapper = moduleWrapper.getElementsByClassName("module-content"); var headerWrapper = moduleWrapper.getElementsByClassName("module-header");