Skip to content

Commit

Permalink
Do not restore property if not found in state
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriyDurov committed Sep 11, 2024
1 parent a5c2e61 commit eb0f5b5
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ protected void RestoreComponentState(JsonObject state)
var propertyInfo = property.PropertyInfo;
var value = state[propertyInfo.Name];

if (value is null)
{
throw new UnreachableException();
}
if (value is null) continue;

var deserializedValue = value.Deserialize(propertyInfo.PropertyType, serializerOptions);
propertyInfo.SetValue(PersistentComponent, deserializedValue);
Expand Down

0 comments on commit eb0f5b5

Please sign in to comment.