[gnome-games] ui: Check for null in SidebarView.model setter
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] ui: Check for null in SidebarView.model setter
- Date: Thu, 16 Aug 2018 09:02:47 +0000 (UTC)
commit ab5bb2e33c8df13a385e64ae3e67c29b74ac684e
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Wed Aug 15 01:17:52 2018 +0500
ui: Check for null in SidebarView.model setter
Prevents runtime warnings on connecting handlers to a null object.
src/ui/sidebar-view.vala | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/sidebar-view.vala b/src/ui/sidebar-view.vala
index 5420546b..16bd21ff 100644
--- a/src/ui/sidebar-view.vala
+++ b/src/ui/sidebar-view.vala
@@ -13,7 +13,9 @@ private abstract class Games.SidebarView : Gtk.Box {
set {
_model = value;
collection_view.model = _model;
- model.items_changed.connect (on_model_changed);
+
+ if (model != null)
+ model.items_changed.connect (on_model_changed);
}
get { return _model; }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]