Closed ktaki closed 8 years ago
I ran into this once yesterday but cnr on subsequent attempts. Thanks for tracking this down.
I can repro. The problem is that the action assumes that a valid document model exists because the menu command is supposed to be disabled when that isn't the case. But the menu is not rebuilt for a few hundred milliseconds after the models are updated so that updates can be grouped, thus reducing unnecessary work. As a result, the File > Close
command is enabled when it shouldn't be after the last document is closed, and so the user is allowed to execute a documents.close
action in a state that violates that action's precondition. Simple fix coming right up...
FBNC to @ktaki
Verified the fix.
Action documents.close failed: TypeError: Cannot read property 'id' of null
The error can be seen closing large documents in succession by repeated Cmd/Ctrl-w, but easiest method for reproducing this error is the following.
Note: A similar issue was reported and fixed in the issue #1813.