[chronojump] Fixed possible crash on open news web



commit 28218e1e9c0e38e94a151e845fc8e0427eae28f8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jul 26 11:43:26 2021 +0200

    Fixed possible crash on open news web

 src/gui/app1/news.cs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/gui/app1/news.cs b/src/gui/app1/news.cs
index 57f2c2135..3338c7297 100644
--- a/src/gui/app1/news.cs
+++ b/src/gui/app1/news.cs
@@ -312,6 +312,10 @@ public partial class ChronoJumpWindow
 
        private void on_button_new_open_browser_clicked (object o, EventArgs args)
        {
+               //just a precaution
+               if(newsAtDB_l == null || currentNewsPos < 0 || currentNewsPos >= newsAtDB_l.Count)
+                       return;
+
                string link = newsAtDB_l[currentNewsPos].GetLink(preferences.newsLanguageEs);
 
                LogB.Information("Opening browser (r mac install) to: " + link);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]