Handled invalid/malformed response from origin #253
This commit is contained in:
@@ -52,8 +52,6 @@ namespace updater {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
|
||||||
char response;
|
char response;
|
||||||
if (!automatic_update) {
|
if (!automatic_update) {
|
||||||
std::cout << "[updater] Do you want to download the latest offsets? (y/n): ";
|
std::cout << "[updater] Do you want to download the latest offsets? (y/n): ";
|
||||||
@@ -108,12 +106,13 @@ namespace updater {
|
|||||||
if (data.empty())
|
if (data.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (data.is_array()) {
|
if (!data.is_array())
|
||||||
json last_commit = data[0];
|
return false;
|
||||||
json last_commit_author = last_commit["commit"]["author"];
|
|
||||||
|
|
||||||
commit = last_commit_author;
|
json last_commit = data[0];
|
||||||
}
|
json last_commit_author = last_commit["commit"]["author"];
|
||||||
|
|
||||||
|
commit = last_commit_author;
|
||||||
|
|
||||||
InternetCloseHandle(hConnect);
|
InternetCloseHandle(hConnect);
|
||||||
InternetCloseHandle(hInternet);
|
InternetCloseHandle(hInternet);
|
||||||
|
|||||||
@@ -86,7 +86,12 @@ int main() {
|
|||||||
std::cout << "[updater] Error reading config file, reseting to the default state\n" << std::endl;
|
std::cout << "[updater] Error reading config file, reseting to the default state\n" << std::endl;
|
||||||
|
|
||||||
#ifndef _UC
|
#ifndef _UC
|
||||||
updater::check_and_update(config::automatic_update);
|
try {
|
||||||
|
updater::check_and_update(config::automatic_update);
|
||||||
|
}
|
||||||
|
catch (std::exception& e) {
|
||||||
|
std::cout << "An exceptio was caught while read " << e.what() << std::endl;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::cout << "[updater] Reading offsets from file offsets.json." << std::endl;
|
std::cout << "[updater] Reading offsets from file offsets.json." << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user