Parcourir la source

Fixes System.NullReferenceException exception.

BDisp il y a 2 ans
Parent
commit
e5f21fa2d9
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  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 ());
 		}