[chronojump] Two safety checks on cjCombo to avoid read from null combos
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Two safety checks on cjCombo to avoid read from null combos
- Date: Mon, 28 Feb 2022 16:39:35 +0000 (UTC)
commit 451610629dc0b6c079e9c24d73833584704e1635
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Feb 28 17:37:55 2022 +0100
Two safety checks on cjCombo to avoid read from null combos
src/gui/cjCombo.cs | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/src/gui/cjCombo.cs b/src/gui/cjCombo.cs
index ce2b1e456..9ea4efb67 100644
--- a/src/gui/cjCombo.cs
+++ b/src/gui/cjCombo.cs
@@ -27,6 +27,8 @@ public partial class ChronoJumpWindow
int getExerciseIDFromName (string [] comboArrayString, string name, bool comboWithTranslation)
{
LogB.Information("getExerciseIDFromName for: " + name);
+ if(comboArrayString == null)
+ return -1;
string idFound = "";
@@ -50,6 +52,9 @@ public partial class ChronoJumpWindow
int getExerciseIDFromAnyCombo(Gtk.ComboBox combo, string [] comboArrayString, bool
comboWithTranslation)
{
+ if(combo == null)
+ return -1;
+
return getExerciseIDFromName(comboArrayString, UtilGtk.ComboGetActive(combo),
comboWithTranslation);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]