From: "Lubomir I. Ivanov" <[email protected]>

MainWindow::on_actionReplanDive_triggered():

If a dive in the divelist does not have a "DC Model" for some reason,
selecting "re-plan" from the menu will pass a NULL value
current_dive->dc.model to strcmp() and break before the debug output.

To fix that we check if the said .model value is NULL.

Signed-off-by: Lubomir I. Ivanov <[email protected]>
---
 qt-ui/mainwindow.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index dfe8a23..f13601d 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -451,7 +451,7 @@ void MainWindow::on_actionReplanDive_triggered()
 {
        if (!plannerStateClean())
                return;
-       if (!current_dive || strcmp(current_dive->dc.model, "planned dive")) {
+       if (!current_dive || !current_dive->dc.model || 
strcmp(current_dive->dc.model, "planned dive")) {
                qDebug() << current_dive->dc.model;
                return;
        }
-- 
1.7.11.msysgit.0

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to