Skip to content

Commit 060919a

Browse files
committed
Avoid launching fallback dialog on cancellation
1 parent 9c86496 commit 060919a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Bonsai.Scripting.IronPython.Design/PythonScriptEditor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ public override object EditValue(ITypeDescriptorContext context, IServiceProvide
3131
{
3232
using var editorDialog = new PythonScriptEditorDialog();
3333
editorDialog.Script = (string)value;
34-
if (editorService.ShowDialog(editorDialog) == DialogResult.OK)
35-
{
36-
return editorDialog.Script;
37-
}
34+
return editorService.ShowDialog(editorDialog) == DialogResult.OK
35+
? editorDialog.Script
36+
: value;
3837
}
3938
}
4039

0 commit comments

Comments
 (0)