Mass: fix another bug with importing.

This commit is contained in:
Guillaume Jacquemin 2021-10-14 15:06:03 +02:00
parent dd460b4313
commit b92c37e4b6

View file

@ -864,19 +864,13 @@ auto Mass::writeGlobalStyle(UnsignedLong index) -> bool {
auto Mass::updateSteamId(const std::string& steam_id) -> bool {
_steamId = steam_id;
auto unit_data = _mass->at<GenericStructProperty>("UnitData");
if(!unit_data) {
auto account = _mass->at<StringProperty>("Account");
if(!account) {
_state = State::Invalid;
return false;
}
auto account_prop = unit_data->at<StringProperty>("Account");
if(!account_prop) {
_state = State::Invalid;
return false;
}
account_prop->value = steam_id;
account->value = steam_id;
return _mass->saveToFile();
}