diff --git a/src/Components/Modules/News.cpp b/src/Components/Modules/News.cpp index c0ca72dc..2c82a22c 100644 --- a/src/Components/Modules/News.cpp +++ b/src/Components/Modules/News.cpp @@ -64,14 +64,17 @@ namespace Components std::string error; json11::Json client = json11::Json::parse(_client.data(), error); - std::string revisionString = client["revision"].string_value(); - - if (!revisionString.empty()) + if (client["revision"].is_string()) { - int revision = atoi(revisionString.data()); + std::string revisionString = client["revision"].string_value(); - Dvar::Var("cl_updateversion").get()->current.integer = revision; - Dvar::Var("cl_updateavailable").get()->current.boolean = (revision > REVISION); + if (!revisionString.empty()) + { + int revision = atoi(revisionString.data()); + + Dvar::Var("cl_updateversion").get()->current.integer = revision; + Dvar::Var("cl_updateavailable").get()->current.boolean = (revision > REVISION); + } } } }