aboutsummaryrefslogtreecommitdiff
path: root/src/stardict-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stardict-view.c')
-rw-r--r--src/stardict-view.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stardict-view.c b/src/stardict-view.c
index f7e12c9..1e65b0c 100644
--- a/src/stardict-view.c
+++ b/src/stardict-view.c
@@ -533,14 +533,14 @@ stardict_view_set_position (StardictView *self,
StardictDict *dict, guint position)
{
g_return_if_fail (STARDICT_IS_VIEW (self));
- g_return_if_fail (STARDICT_IS_DICT (dict));
+ g_return_if_fail (dict == NULL || STARDICT_IS_DICT (dict));
// Update the minimum size, if appropriate (almost never)
if (!self->dict != !dict)
gtk_widget_queue_resize (GTK_WIDGET (self));
g_clear_object (&self->dict);
- self->dict = g_object_ref (dict);
+ self->dict = dict ? g_object_ref (dict) : NULL;
self->top_position = position;
self->top_offset = 0;