瀏覽代碼

Bug 1684: Failure when canceling session reconnect (6th)

https://winscp.net/tracker/1684

Source commit: 6b94f70d49ff39f5faaccc1fd51587f6eb4bdbf8
Martin Prikryl 6 年之前
父節點
當前提交
c62d3a92ef
共有 2 個文件被更改,包括 16 次插入7 次删除
  1. 12 6
      source/core/Terminal.cpp
  2. 4 1
      source/forms/CustomScpExplorer.cpp

+ 12 - 6
source/core/Terminal.cpp

@@ -1919,14 +1919,20 @@ void __fastcall TTerminal::SaveCapabilities(TFileSystemInfo & FileSystemInfo)
 //---------------------------------------------------------------------------
 bool __fastcall TTerminal::GetIsCapable(TFSCapability Capability) const
 {
-  DebugAssert(FFileSystem);
-  switch (Capability)
+  if (DebugAlwaysTrue(FFileSystem != NULL))
   {
-    case fsBackgroundTransfers:
-      return !IsEncryptingFiles();
+    switch (Capability)
+    {
+      case fsBackgroundTransfers:
+        return !IsEncryptingFiles();
 
-    default:
-      return FFileSystem->IsCapable(Capability);
+      default:
+        return FFileSystem->IsCapable(Capability);
+    }
+  }
+  else
+  {
+    return false;
   }
 }
 //---------------------------------------------------------------------------

+ 4 - 1
source/forms/CustomScpExplorer.cpp

@@ -486,7 +486,10 @@ void __fastcall TCustomScpExplorerForm::CreateHiddenWindow()
 //---------------------------------------------------------------------------
 bool __fastcall TCustomScpExplorerForm::CanConsole()
 {
-  return (Terminal != NULL) && (Terminal->IsCapable[fcAnyCommand] || Terminal->IsCapable[fcSecondaryShell]);
+  return
+    (Terminal != NULL) &&
+    Terminal->Active &&
+    (Terminal->IsCapable[fcAnyCommand] || Terminal->IsCapable[fcSecondaryShell]);
 }
 //---------------------------------------------------------------------------
 bool __fastcall TCustomScpExplorerForm::CanCommandLineFromAnotherInstance()