Guard code for context.mode

In case this is somehow called before initialization is complete
It happens rarely when restoring the initial changes and deferring rendering
This commit is contained in:
Bryan Housel
2018-01-19 11:44:14 -05:00
parent 1cfda3ec86
commit 9b99115b3e

View File

@@ -24,7 +24,8 @@ export function uiModes(context) {
function editable() {
return context.editable() && context.mode().id !== 'save';
var mode = context.mode();
return context.editable() && mode && mode.id !== 'save';
}