From 065a8e712c532e824db8b7cb741894bd559009e6 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 18 Aug 2020 11:07:38 -0400 Subject: [PATCH] Fixed BE client potentially segfaulting on startup --- core/src/mindustry/net/BeControl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/net/BeControl.java b/core/src/mindustry/net/BeControl.java index 23d523f787..3632e34591 100644 --- a/core/src/mindustry/net/BeControl.java +++ b/core/src/mindustry/net/BeControl.java @@ -47,7 +47,7 @@ public class BeControl{ /** asynchronously checks for updates. */ public void checkUpdate(Boolc done){ - Core.net.httpGet("https://api.github.com/repos/Anuken/MindustryBuilds/releases/latest", res -> { + Core.net.httpGet("https://api.github.com/repos/Anuken/MindustryBuilds/releases/latest", res -> Core.app.post(() -> { if(res.getStatus() == HttpStatus.OK){ Jval val = Jval.read(res.getResultAsString()); int newBuild = Strings.parseInt(val.getString("tag_name", "0")); @@ -65,13 +65,13 @@ public class BeControl{ }else{ Core.app.post(() -> done.get(false)); } - }, error -> { + }), error -> Core.app.post(() -> { if(!headless){ ui.showException(error); }else{ error.printStackTrace(); } - }); + })); } /** @return whether a new update is available */