We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73795b3 commit 23dc3cbCopy full SHA for 23dc3cb
1 file changed
src/GtmExtension/GtmListener.cs
@@ -92,7 +92,11 @@ private void ShowError(string message)
92
93
private string GetFilePath(ITextView textView)
94
{
95
- return textView.TextBuffer.Properties.GetProperty<ITextDocument>(typeof(ITextDocument)).FilePath;
+ if (textView.TextBuffer.Properties.TryGetProperty(typeof(ITextDocument), out ITextDocument doc))
96
+ {
97
+ return doc.FilePath;
98
+ }
99
+ return null;
100
}
101
102
private void GetService<T>(ref T field) { field = GetService<T>(); }
@@ -237,6 +241,8 @@ private void Initialize()
237
241
238
242
private void Update(string path, bool force = false)
239
243
244
+ if (path == null) { return; }
245
+
240
246
ThreadHelper.ThrowIfNotOnUIThread();
247
248
var time = DateTime.Now;
0 commit comments