summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/command.cpp')
-rw-r--r--desktop-widgets/command.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop-widgets/command.cpp b/desktop-widgets/command.cpp
index 35010b3c3..78f849651 100644
--- a/desktop-widgets/command.cpp
+++ b/desktop-widgets/command.cpp
@@ -148,9 +148,8 @@ void purgeUnusedDiveSites()
// Execute an edit-command and return number of edited dives
static int execute_edit(EditDivesBase *cmd)
{
- int res = cmd->numDives();
- execute(cmd);
- return res;
+ int count = cmd->numDives();
+ return execute(cmd) ? count : 0;
}
// Dive editing related commands