summaryrefslogtreecommitdiff
path: root/gtk/gtkscrollbar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-04-03 23:31:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-04-03 23:31:45 -0400
commit5205fa0ff7635154a76e7c810bfc00cf041029ca (patch)
treeaf259ff19568ee6cd3f9bcc77e56e445b3192da6 /gtk/gtkscrollbar.c
parent339d3e41b028344e647d7a5795ace4eb53085ddd (diff)
downloadgtk+-5205fa0ff7635154a76e7c810bfc00cf041029ca.tar.gz
scrollbar: Be more defensive
Somehow the scrollbar accessible manages to call gtk_scrollbar_get_adjustment when priv->range is NULL. Survive taht.
Diffstat (limited to 'gtk/gtkscrollbar.c')
-rw-r--r--gtk/gtkscrollbar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index 97730e1eea..84b18c02dc 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -285,5 +285,8 @@ gtk_scrollbar_get_adjustment (GtkScrollbar *self)
g_return_val_if_fail (GTK_IS_SCROLLBAR (self), NULL);
- return gtk_range_get_adjustment (GTK_RANGE (priv->range));
+ if (priv->range)
+ return gtk_range_get_adjustment (GTK_RANGE (priv->range));
+
+ return NULL;
}