summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/LoadPatchWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/gui/LoadPatchWindow.cpp')
-rw-r--r--src/libs/gui/LoadPatchWindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp
index 9c31c64c..66aec5b0 100644
--- a/src/libs/gui/LoadPatchWindow.cpp
+++ b/src/libs/gui/LoadPatchWindow.cpp
@@ -116,6 +116,9 @@ LoadPatchWindow::poly_from_user_selected()
void
LoadPatchWindow::ok_clicked()
{
+ if (!_patch)
+ return;
+
// If unset load_patch will load value
optional<const string&> name;
@@ -129,11 +132,12 @@ LoadPatchWindow::ok_clicked()
if (_patch->path() != "/")
parent = _patch->path().parent();
+
+ _patch.reset();
+ hide();
App::instance().loader()->load_patch(true, get_uri(), "/",
_initial_data, parent, name);
-
- hide();
}