Profile: ensure (in)validity.

This commit is contained in:
Guillaume Jacquemin 2021-09-27 16:17:32 +02:00
parent 911e18fc0a
commit bd255ef8d5

View file

@ -48,6 +48,8 @@ Profile::Profile(const std::string& path):
_steamId = Utility::String::ltrim(Utility::String::rtrim(_filename, ".sav"), (_type == ProfileType::Demo ? "Demo" : "") + std::string{"Profile"}); _steamId = Utility::String::ltrim(Utility::String::rtrim(_filename, ".sav"), (_type == ProfileType::Demo ? "Demo" : "") + std::string{"Profile"});
refreshValues();
_valid = _profile.valid(); _valid = _profile.valid();
} }
@ -74,6 +76,7 @@ auto Profile::steamId() const -> std::string const& {
void Profile::refreshValues() { void Profile::refreshValues() {
if(!_profile.reloadData()) { if(!_profile.reloadData()) {
_lastError = _profile.lastError(); _lastError = _profile.lastError();
_valid = false;
return; return;
} }