Merge pull request #1571 from kolbyjack/develop

Fix null dereference in moduleNeedsUpdate when the module isn't visible
This commit is contained in:
Michael Teeuw 2019-02-15 13:57:24 +01:00 committed by GitHub
commit f7f4043ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Installation script problems with raspbian - 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: 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) - 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 ### New weather module
- Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499).

View File

@ -173,6 +173,10 @@ var MM = (function() {
*/ */
var moduleNeedsUpdate = function(module, newHeader, newContent) { var moduleNeedsUpdate = function(module, newHeader, newContent) {
var moduleWrapper = document.getElementById(module.identifier); var moduleWrapper = document.getElementById(module.identifier);
if (moduleWrapper === null) {
return false;
}
var contentWrapper = moduleWrapper.getElementsByClassName("module-content"); var contentWrapper = moduleWrapper.getElementsByClassName("module-content");
var headerWrapper = moduleWrapper.getElementsByClassName("module-header"); var headerWrapper = moduleWrapper.getElementsByClassName("module-header");