Skip to content

Commit 6b8148f

Browse files
committed
misc: Avoid some navigation warnings that can crop up when images
are actively loading in the background.
1 parent b658637 commit 6b8148f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/xviewer-thumb-view.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,12 @@ xviewer_thumb_view_select_single (XviewerThumbView *thumbview,
10211021
}
10221022
}
10231023

1024-
gtk_icon_view_select_path (GTK_ICON_VIEW (thumbview), path);
1025-
gtk_icon_view_set_cursor (GTK_ICON_VIEW (thumbview), path, NULL, FALSE);
1026-
gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (thumbview), path, FALSE, 0, 0);
1027-
gtk_tree_path_free (path);
1024+
if (path != NULL) {
1025+
gtk_icon_view_select_path (GTK_ICON_VIEW (thumbview), path);
1026+
gtk_icon_view_set_cursor (GTK_ICON_VIEW (thumbview), path, NULL, FALSE);
1027+
gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (thumbview), path, FALSE, 0, 0);
1028+
gtk_tree_path_free (path);
1029+
}
10281030
}
10291031

10301032

src/xviewer-window.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ update_image_pos (XviewerWindow *window)
495495

496496
n_images = xviewer_list_store_length (XVIEWER_LIST_STORE (priv->store));
497497

498-
if (n_images > 0) {
498+
if (priv->image != NULL && n_images > 0) {
499499
pos = xviewer_list_store_get_pos_by_image (XVIEWER_LIST_STORE (priv->store),
500500
priv->image);
501501
}

0 commit comments

Comments
 (0)