Editor: fix a crash on canceling dialog in "New resource" (#164).