Skip to content

Commit

Permalink
Fix cold data bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarBLG committed Sep 1, 2023
1 parent a4fbd46 commit ff00fd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions EVC/TrainSubsystems/cold_movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void save_cold_data(std::string field, json &value)
json load_cold_data(std::string field)
{
auto contents = platform->read_file("cold_data.json");
if (!contents)
return json();
json j = json::parse(*contents);
json j;
if (contents)
j = json::parse(*contents);
if (!j.contains(field)) j[field] = json();
return j[field];
}

0 comments on commit ff00fd9

Please sign in to comment.