diff --git a/Codist/NaviBar/NaviBarFactory.cs b/Codist/NaviBar/NaviBarFactory.cs index 454ea693..26424a46 100644 --- a/Codist/NaviBar/NaviBarFactory.cs +++ b/Codist/NaviBar/NaviBarFactory.cs @@ -44,7 +44,7 @@ public void TextViewCreated(IWpfTextView textView) { static void AssociateFileCodeModelOverrider() { Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); - var model = CodistPackage.DTE2.ActiveDocument?.ProjectItem.FileCodeModel; // the active document can be null + var model = CodistPackage.DTE2.ActiveDocument?.ProjectItem?.FileCodeModel; // the active document can be null if (model == null) { return; }