瀏覽代碼

Closing application when Login dialog opened after handling URL with "save" extension is canceled.

Source commit: 70a90828e62ee1df62441d3829d192095552175f
Martin Prikryl 9 年之前
父節點
當前提交
9705193387
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      source/windows/WinMain.cpp

+ 9 - 2
source/windows/WinMain.cpp

@@ -78,10 +78,16 @@ void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
     // Note that GetFolderOrWorkspace never returns sites that !CanLogin,
     // so we should not get here with more then one site.
     // Though we should be good, if we ever do.
+
+    // We get here when:
+    // - we need session for explicit command-line operation
+    // - after we handle "save" URL.
+    // - the specified session does not contain enough information to login [= not even hostname]
+
     DebugAssert(DataList->Count <= 1);
     if (!DoLoginDialog(StoredSessions, DataList, loStartup))
     {
-      DataList->Clear();
+      Abort();
     }
   }
 }
@@ -902,7 +908,8 @@ int __fastcall Execute()
         GetLoginData(AutoStartSession, Params, DataList, DownloadFile, NeedSession);
         try
         {
-          if (!NeedSession || (DataList->Count > 0))
+          // GetLoginData now Aborts when session is needed and none is selected
+          if (DebugAlwaysTrue(!NeedSession || (DataList->Count > 0)))
           {
             if (CheckSafe(Params))
             {