mustache-sharp icon indicating copy to clipboard operation
mustache-sharp copied to clipboard

Sporadic NullReferenceException's

Open kevinsbennett opened this issue 10 years ago • 1 comments

I am getting some null reference exceptions while debugging... they are always happening on startup of a web application. Below is the stack trace... any ideas?

at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Mustache.PropertyDictionary.getCacheType(Object instance) at Mustache.PropertyDictionary..ctor(Object instance) at Mustache.Scope.toLookup(Object value) at Mustache.Scope.tryFindFirst(SearchResults results) at Mustache.Scope.tryFind(String name) at Mustache.Scope.Find(String name) at Mustache.KeyGenerator.Mustache.IGenerator.GetText(Scope scope, TextWriter writer, Scope context) at Mustache.CompoundGenerator.Mustache.IGenerator.GetText(Scope keyScope, TextWriter writer, Scope contextScope) at Mustache.Generator.render(IFormatProvider provider, Object source) at Mustache.Generator.Render(Object source)

kevinsbennett avatar Aug 22 '14 05:08 kevinsbennett

Which version of the code are you using? In a recent commit I added a lock to eliminate race conditions caused by multiple threads: https://github.com/jehugaleahsa/mustache-sharp/tree/80824c4e4b42b933e088603afb439885debc65ee. Let me know if you are still seeing this happen with this latest code.

jehugaleahsa avatar Aug 22 '14 13:08 jehugaleahsa