Re #4918. Fixed the crash in user function dialog.
Merge remote-tracking branch 'origin/bugfix/4918_crash_saving_function_twice'