Avoid crash when moving mouse to left side of the plot when showing
mean depth

Signed-off-by: Krzysztof Arentowicz <k.arentow...@gmail.com>
---
 qt-ui/profile/diveprofileitem.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/profile/diveprofileitem.cpp 
b/qt-ui/profile/diveprofileitem.cpp
index e0f3ac8..887ebcd 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -990,7 +990,7 @@ void InstantMeanDepthLine::mouseMoved(int time, int depth)
        int count = model->data().nr;
        for(int i = 0; i < count; i++){
                struct plot_data pI = model->data().entry[i];
-               if (pI.sec == time) {
+               if (pI.sec == time && pI.sec != 0) {
                        setMeanDepth(pI.running_sum / time);
                        setLine(0, 0, hAxis->posAtValue(time), 0);
                        setPos(pos().x(), vAxis->posAtValue(pI.running_sum / 
time));
-- 
1.9.1
_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to