[hyena/gtk3] ListView: null check before subscribing to ValueChanged (bgo#706272)
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena/gtk3] ListView: null check before subscribing to ValueChanged (bgo#706272)
- Date: Sat, 24 Aug 2013 10:08:49 +0000 (UTC)
commit 3d31127ee30fa3b988c243cb4bf367d348e8e548
Author: Andrés G. Aragoneses <knocte gmail com>
Date: Sat Aug 24 12:08:32 2013 +0200
ListView: null check before subscribing to ValueChanged (bgo#706272)
This was causing a NullReferenceException when closing the listview
window when running the demo ('make hg').
.../ListView/ListView_Interaction.cs | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
index cc7ecb3..4c533a5 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
@@ -86,7 +86,9 @@ namespace Hyena.Data.Gui
vadjustment.ValueChanged -= OnVadjustmentChanged;
}
vadjustment = value;
- vadjustment.ValueChanged += OnVadjustmentChanged;
+ if (vadjustment != null) {
+ vadjustment.ValueChanged += OnVadjustmentChanged;
+ }
UpdateAdjustments ();
}
}
@@ -102,7 +104,9 @@ namespace Hyena.Data.Gui
hadjustment.ValueChanged -= OnHadjustmentChanged;
}
hadjustment = value;
- hadjustment.ValueChanged += OnHadjustmentChanged;
+ if (hadjustment != null) {
+ hadjustment.ValueChanged += OnHadjustmentChanged;
+ }
UpdateAdjustments ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]