Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor Ivy committed Apr 26, 2024
1 parent 31f0dc7 commit 9736d56
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ public class SpeckleNewtonsoftSerializer : ISerializer
{
public string Serialize<T>(T obj) => JsonConvert.SerializeObject(obj);

public T Deserialize<T>(string serialized) => JsonConvert.DeserializeObject<T>(serialized);
public T Deserialize<T>(string serialized) =>
JsonConvert.DeserializeObject<T>(serialized)
?? throw new InvalidOperationException(
$"Unable to deserialize the provided JSON into an object of type {typeof(T)}"
);
}

0 comments on commit 9736d56

Please sign in to comment.