Browse Source

Fixes System.NullReferenceException exception.

BDisp 2 years ago
parent
commit
e5f21fa2d9
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Terminal.Gui/Windows/FileDialog.cs

+ 6 - 0
Terminal.Gui/Windows/FileDialog.cs

@@ -116,11 +116,17 @@ namespace Terminal.Gui {
 
 		void Watcher_Error (object sender, ErrorEventArgs e)
 		{
+			if (Application.MainLoop == null)
+				return;
+
 			Application.MainLoop.Invoke (() => Reload ());
 		}
 
 		void Watcher_Changed (object sender, FileSystemEventArgs e)
 		{
+			if (Application.MainLoop == null)
+				return;
+
 			Application.MainLoop.Invoke (() => Reload ());
 		}