Make sure that "method" is a function
It could be null or anything else really, so better be safe than sorry ;) See comments in ntoff/OctoPrint-Estop#4
This commit is contained in:
1 parent
effefffe74
commit
cfb0eb84e2
1 file changed
+1
-1
@@ -1051,7 +1051,7 @@ function callViewModelIf(viewModel, method, condition, callback, raiseErrors) {
|
||||
condition = function() { return true; };
|
||||
}
|
||||
|
||||
if (!viewModel.hasOwnProperty(method) || !condition(viewModel, method)) return;
|
||||
if (!viewModel.hasOwnProperty(method) || !_.isFunction(viewModel[method]) || !condition(viewModel, method)) return;
|
||||
|
||||
var parameters = undefined;
|
||||
if (!_.isFunction(callback)) {
|
||||
|
||||
Reference in new issue
Block a user