Explorar el Código

Fixes System.NullReferenceException exception.

BDisp hace 2 años
padre
commit
e5f21fa2d9
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  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 ());
 		}