[Bug] Undoing "Add function" while naming crashes editor

Creating a new function and then, while giving it a name, pressing ctrl-z will crash the editor.
I have been able to reproduce this in a clean function.

Bump. Bump.