[platform] report assertion instead of failing with NPE if markCurrentCommandAsGlobal is called not inside command

This is a temporary workaround for KT-40787.

GitOrigin-RevId: f4b65d9df9bdd90ccf7ab449ce9cedd2c3adff0a
This commit is contained in:
Nikolay Chashnikov
2020-08-03 13:58:39 +00:00
committed by intellij-monorepo-bot
parent 35dfbddd7b
commit 4f88934707
@@ -291,6 +291,10 @@ public class UndoManagerImpl extends UndoManager {
}
public void markCurrentCommandAsGlobal() {
if (myCurrentMerger == null) {
LOG.error("Must be called inside command");
return;
}
myCurrentMerger.markAsGlobal();
}