Skip to content

Commit fa47280

Browse files
authored
Merge pull request #268 from fakusb/fix-unshelved-goal-error
fixed leaking error message when only shelved goals remain
2 parents 3f24ef2 + 73474fa commit fa47280

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html_views/src/goals/StateModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class StateModel {
190190
])
191191
var elmnt = document.getElementById("firstGoal");
192192
elmnt.scrollIntoView({block: "center", inline: "nearest"});
193-
} else if (state.backgroundGoals.before.length > 0 || state.backgroundGoals.after.length > 0 || state.backgroundGoals.next != undefined ) {
193+
} else if (state.backgroundGoals && (state.backgroundGoals.before.length > 0 || state.backgroundGoals.after && state.backgroundGoals.after.length > 0 || state.backgroundGoals.next)) {
194194
this.setMessage("There are unfocused goals.");
195195
} else if (state.shelvedGoals.length > 0 ) {
196196
this.setMessage("There are shelved goals. Try using `Unshelve`.");

0 commit comments

Comments
 (0)