From 66d4631048edba14e6ebf3368bb2b89c7457d15d Mon Sep 17 00:00:00 2001 From: tkashkin Date: Sun, 5 Jan 2020 04:53:36 +0300 Subject: [PATCH] More null checks --- src/ui/views/GameDetailsView/blocks/GOGDetails.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/views/GameDetailsView/blocks/GOGDetails.vala b/src/ui/views/GameDetailsView/blocks/GOGDetails.vala index 80ff1deb..1b49fb4c 100644 --- a/src/ui/views/GameDetailsView/blocks/GOGDetails.vala +++ b/src/ui/views/GameDetailsView/blocks/GOGDetails.vala @@ -63,10 +63,10 @@ namespace GameHub.UI.Views.GameDetailsView.Blocks add(link); add(new Separator(Orientation.HORIZONTAL)); - var sys_langs = Intl.get_language_names(); - var langs = root.get_object().get_object_member("languages"); + var langs = Parser.json_object(root, {"languages"}); if(langs != null) { + var sys_langs = Intl.get_language_names(); var langs_string = ""; foreach(var l in langs.get_members()) { @@ -204,7 +204,7 @@ namespace GameHub.UI.Views.GameDetailsView.Blocks { Allocation alloc; content.get_allocation(out alloc); - if(s.download != null) + if(s.download != null && s.download.status != null) { progress_bar.get_style_context().add_class("downloading"); progress_bar.set_size_request((int) (s.download.status.progress * alloc.width), alloc.height);