summaryrefslogtreecommitdiffstats
path: root/src/verbs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/verbs.cpp')
-rw-r--r--src/verbs.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/verbs.cpp b/src/verbs.cpp
index ab6c25973..eee7aef75 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -1372,6 +1372,10 @@ void LayerVerb::perform(SPAction *action, void *data)
survivor = Inkscape::previous_layer(dt->currentRoot(), old_layer);
}
+ if (survivor == old_layer->lastChild()) {
+ //oops: layer_fns messed up. BADLY.
+ survivor = NULL;
+ }
// Deleting the old layer before switching layers is a hack to trigger the
// listeners of the deletion event (as happens when old_layer is deleted using the
// xml editor). See