소스 검색

Fixes System.NullReferenceException exception.

BDisp 2 년 전
부모
커밋
a3059ae4a5
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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)
 		void Watcher_Error (object sender, ErrorEventArgs e)
 		{
 		{
+			if (Application.MainLoop == null)
+				return;
+
 			Application.MainLoop.Invoke (() => Reload ());
 			Application.MainLoop.Invoke (() => Reload ());
 		}
 		}
 
 
 		void Watcher_Changed (object sender, FileSystemEventArgs e)
 		void Watcher_Changed (object sender, FileSystemEventArgs e)
 		{
 		{
+			if (Application.MainLoop == null)
+				return;
+
 			Application.MainLoop.Invoke (() => Reload ());
 			Application.MainLoop.Invoke (() => Reload ());
 		}
 		}