From 538c5b69fb5232566dd18a91badb58fbaa366629 Mon Sep 17 00:00:00 2001 From: WMJ Date: Thu, 20 Dec 2018 21:55:13 +0800 Subject: [PATCH] - Fixed a crash in debugging release --- Codist/NaviBar/NaviBarFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }