summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/selection-chemistry.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index ec4f096dd..0aa884f56 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3002,8 +3002,11 @@ void fit_canvas_to_selection(SPDesktop *desktop) {
g_return_if_fail(doc != NULL);
g_return_if_fail(desktop->selection != NULL);
- g_return_if_fail(!desktop->selection->isEmpty());
+ if (desktop->selection->isEmpty()) {
+ desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to fit canvas to."));
+ return;
+ }
NR::Maybe<NR::Rect> const bbox(desktop->selection->bounds());
if (bbox && !bbox->isEmpty()) {
doc->fitToRect(*bbox);