undoclose: fix crash