Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelConverter.ReadJson throws exception on empty Media property (possible others) solution added #45

Open
raymondvisser1977 opened this issue Dec 21, 2021 · 1 comment

Comments

@raymondvisser1977
Copy link

var obj = serializer.Deserialize(reader);

obj becomes null and following throws exception
var contentTypeAlias = obj.GetValue(_aliasProperty).Value();

possible solution
after
var obj = serializer.Deserialize(reader);
put this
if(obj == null) return null;

@raymondvisser1977
Copy link
Author

To replicate create a model with:
public Media SomeImage { get; set; }

Leave it empty in umbraco heartcore and try to retreive it. It will throw an exception. This was not the case earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant