U4-2447 - NullReferenceException in umbraco.controls.ContentTypeControlNew.IconClassToIconFileName(String iconClass)

Created by Kieron McIntyre 02 Jul 2013, 14:30:23 Updated by Shannon Deminick 04 Jul 2013, 02:21:11

I have had the following exception raised from Umbraco v6.1.1 several times now, all with seemingly no cause:

Stack trace: at umbraco.controls.ContentTypeControlNew.IconClassToIconFileName(String iconClass) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at umbraco.controls.ContentTypeControlNew.SetupInfoPane() at umbraco.controls.ContentTypeControlNew.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

It seems to be linked to using FamFamFam icons, or maybe just having a lot of icons, and it also doesn't seem to be restricted to v6 as it has been seen in 4.11 too.

The solution so far has been just to restart the app pool, but this is obviously not a great solution.

Several others have had the same issue: http://our.umbraco.org/forum/developers/extending-umbraco/41677-NullReference-exception-on-umbracocontrolsContentTypeControlNewIconClassToIconFileName()

Comments

Shannon Deminick 04 Jul 2013, 01:18:12

I don't think it is famfamfam, i can replicate this without that package installed. It is something to do with the CMSNode.DefaultIconClasses having a null value for one of them. It could be because CMSNode.initializeIconClasses is not thread safe. I'll have a look.


Shannon Deminick 04 Jul 2013, 02:21:11

I think it has to do with thread safety since there's no other way that I can see a null object could be added to the internal list. I also think this issue might date way back to a very old version. It is hard to replicate which is why I'm pretty sure it's a thread safety thing.

I have fixed this in revision: d015780b9f4e778e0cde8ff5ef692e2ac14085af


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.10.0, 4.11.0, 6.0.0, 6.1.0, 4.11.1, 4.11.2, 4.11.3, 4.11.4, 6.0.1, 4.11.5, 6.0.2, 4.11.6, 6.0.3, 6.0.4, 4.11.7, 6.1.1, 6.0.6, 4.11.9, 6.0.5, 4.11.8, 6.0.7, 6.1.2, 4.10.1, 4.11.10

Due in version: 6.1.3

Sprint:

Story Points:

Cycle: