From fe422f7c6b42a0d618b2b49999cfb2210f9ceca5 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Mon, 11 Dec 2017 21:34:40 -0600 Subject: [PATCH] unarchiver: check that XADFileSize is set before reading it Lsar does not set XADFileSize for directories, so we would output a critical when encountering one. https://bugzilla.gnome.org/show_bug.cgi?id=791505 --- src/fr-command-unarchiver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fr-command-unarchiver.c b/src/fr-command-unarchiver.c index a7cdb834..5e8fd705 100644 --- a/src/fr-command-unarchiver.c +++ b/src/fr-command-unarchiver.c @@ -91,7 +91,8 @@ list_command_completed (gpointer data) entry = json_array_get_object_element (content, i); fdata = file_data_new (); - fdata->size = json_object_get_int_member (entry, "XADFileSize"); + if (json_object_has_member (entry, "XADFileSize")) + fdata->size = json_object_get_int_member (entry, "XADFileSize"); fdata->modified = mktime_from_string (json_object_get_string_member (entry, "XADLastModificationDate")); if (json_object_has_member (entry, "XADIsEncrypted")) fdata->encrypted = json_object_get_int_member (entry, "XADIsEncrypted") == 1; -- 2.15.0