filethumbnail: Clear image on failure

Unset the image if we fail to find the appropriate icon, regardless
of the reason of the failure. Prevents the thumbnail to misrepresent
the GFileInfo it's supposed to represent.
This commit is contained in:
Georges Basile Stavracas Neto 2023-02-28 13:52:12 -03:00
parent 2d90031dab
commit 158165f769

View File

@ -78,7 +78,10 @@ update_image (GtkFileThumbnail *self)
int scale;
if (!g_file_info_has_attribute (self->info, G_FILE_ATTRIBUTE_STANDARD_ICON))
return FALSE;
{
gtk_image_clear (GTK_IMAGE (self->image));
return FALSE;
}
scale = gtk_widget_get_scale_factor (GTK_WIDGET (self));
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (self)));
@ -128,7 +131,10 @@ static void
get_thumbnail (GtkFileThumbnail *self)
{
if (!self->info)
return;
{
gtk_image_clear (GTK_IMAGE (self->image));
return;
}
if (!update_image (self))
{