guard against null pointer exception
This commit is contained in:
@@ -70,6 +70,10 @@ define([
|
||||
|
||||
var makeCheckbox = function (id, cb) {
|
||||
var entry = APP.lm.proxy.data[id];
|
||||
if (!entry || typeof(entry) !== 'object') {
|
||||
return void console.log('entry undefined');
|
||||
}
|
||||
|
||||
var checked = entry.state === 1 ?
|
||||
'cp-app-todo-task-checkbox-checked fa-check-square-o':
|
||||
'cp-app-todo-task-checkbox-unchecked fa-square-o';
|
||||
@@ -108,6 +112,9 @@ define([
|
||||
.appendTo($taskDiv);
|
||||
|
||||
var entry = APP.lm.proxy.data[el];
|
||||
if (!entry || typeof(entry) !== 'object') {
|
||||
return void console.log('entry undefined');
|
||||
}
|
||||
|
||||
if (entry.state) {
|
||||
$taskDiv.addClass('cp-app-todo-task-complete');
|
||||
|
||||
Reference in New Issue
Block a user