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

VortoTextString not required without a value throws NullReferenceException #42

Closed
mortenholmgaard opened this issue Mar 3, 2016 · 2 comments

Comments

@mortenholmgaard
Copy link

We have a problem when trying to get the value with item.GetVortoValue("header") from an empty VortoTextString field. It happens both with new and existing nodes.

Stacktrace:

Header = item.GetVortoValue<string>("header");

[NullReferenceException: Object reference not set to an instance of an object.]
Our.Umbraco.Vorto.Extensions.IPublishedContentExtensions.DoInnerGetVortoValue(IPublishedContent content, String propertyAlias, String cultureName, Boolean recursive, T defaultValue) +223
Our.Umbraco.Vorto.Extensions.IPublishedContentExtensions.GetVortoValue(IPublishedContent content, String propertyAlias, String cultureName, Boolean recursive, T defaultValue, String fallbackCultureName) +115

We can see in the umbraco.config cache that only the dtdguid field exists for the property:

<header><![CDATA[{
  "dtdguid": "8e902cf2-a6bc-49bb-9e8f-e37e7d102c2d"
}]]></header>

When we add text to the fields it works fine.

We are using version 1.5 from nuget and Umbraco 7.4.1.

Is it the intention that one should always use item.HasVortoValue("header") first? I think GetVortoValue() should return null when there is no value.

@mattbrailsford
Copy link
Collaborator

Sounds like a duplicate of #41, please try the nightly here https://ci.appveyor.com/project/mattbrailsford/umbraco-vorto/build/1.5.1.36/artifacts

@mortenholmgaard
Copy link
Author

Yes it sounds to be the same problem - I will wait for the nuget update.

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

No branches or pull requests

2 participants