[gimp] app: accept "revision" and "date" fields to be absent on a build...



commit 7b3f696d9d52974637fbbaadc6443ed11cae0c5e
Author: Jehan <jehan girinstud io>
Date:   Thu Feb 6 22:15:11 2020 +0100

    app: accept "revision" and "date" fields to be absent on a build...
    
    ... object in the gimp_versions.json file.

 app/gimp-update.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/app/gimp-update.c b/app/gimp-update.c
index 8fbc094264..7215b4a538 100644
--- a/app/gimp-update.c
+++ b/app/gimp-update.c
@@ -198,8 +198,10 @@ gimp_check_updates_callback (GObject      *source,
                     build_id = json_object_get_string_member (build, "build-id");
                   if (g_strcmp0 (build_id, GIMP_BUILD_ID) == 0)
                     {
-                      build_revision = json_object_get_int_member (build, "revision");
-                      build_date = json_object_get_string_member (build, "date");
+                      if (json_object_has_member (build, "revision"))
+                        build_revision = json_object_get_int_member (build, "revision");
+                      if (json_object_has_member (build, "date"))
+                        build_date = json_object_get_string_member (build, "date");
                       break;
                     }
                 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]