From 8452d96bf6ea4d9c33b874b888b0b42f31a25c01 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 17 Mar 2024 18:16:53 -0400 Subject: [PATCH] Fix update prompt showing up when no update is available if logged out and using the beta channel --- src/client/http/StartupRequest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/http/StartupRequest.cpp b/src/client/http/StartupRequest.cpp index d2a2ce95e..5049f560f 100644 --- a/src/client/http/StartupRequest.cpp +++ b/src/client/http/StartupRequest.cpp @@ -52,6 +52,10 @@ namespace http return; } auto &info = versions[key]; + if (info.isNull()) + { + return; + } auto getOr = [&info](ByteString key, int defaultValue) -> int { if (!info.isMember(key)) { @@ -59,7 +63,7 @@ namespace http } return info[key].asInt(); }; - auto build = getOr(key == "Snapshot" ? "Snapshot" : "Build", -1); + auto build = getOr(key == "Snapshot" ? "Snapshot" : "Build", 0); if (!updateAvailableFunc(build)) { return; @@ -68,8 +72,8 @@ namespace http channel, ByteString::Build(SCHEME, alternate ? UPDATESERVER : SERVER, info["File"].asString()), ByteString(info["Changelog"].asString()).FromUtf8(), - getOr("Major", -1), - getOr("Minor", -1), + getOr("Major", 0), + getOr("Minor", 0), build, }; };