madskristensen / CssTools

A Visual Studio extension
Other
21 stars 5 forks source link

Getting System.NullReferenceException #14

Closed NotAClue closed 6 years ago

NotAClue commented 6 years ago

Installed product versions

Description

I get this error every time I open a .Less file System.NullReferenceException: Object reference not set to an instance of an object. at CssTools.CssExtensions.GetDeclarations(RuleBlock rule) in C:\projects\csstools\src\ExtensionMethods\CssExtensions.cs:line 45 at CssTools.VendorClassifier.UpdateDeclarationCache(ParseItem item) in C:\projects\csstools\src\Classify\VendorClassifier.cs:line 116 at CssTools.VendorClassifier..ctor(IClassificationTypeRegistryService registry, ITextBuffer buffer) in C:\projects\csstools\src\Classify\VendorClassifier.cs:line 59 at CssTools.VendorClassifierProvider.<>cDisplayClass4_0.b0() in C:\projects\csstools\src\Classify\VendorClassifier.cs:line 37 at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator) at CssTools.VendorClassifierProvider.GetClassifier(ITextBuffer textBuffer) in C:\projects\csstools\src\Classify\VendorClassifier.cs:line 37 at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTaggerProvider.<>cDisplayClass12_0`1.b0(IClassifierProvider provider) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeEligibleFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable1 lazyFactories, Func2 getter, IContentType dataContentType, IContentTypeRegistryService contentTypeRegistryService, Object errorSource) --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Steps to recreate

  1. have this extension installed
  2. open Visual Studio
  3. open a .Less file
  4. move cursor into editor
  5. get error popup then open see "ActivityLog.xml"

Current behavior

just get the error at first opening of .Less file

Expected behavior

not get the error?

Saibamen commented 6 years ago

This same error on stable VS 15.8.0, Win 10

conficient commented 6 years ago

Duplicate of #11

madskristensen commented 6 years ago

Fixed in latest release