Browse Source

Failure when switching to a disconnected session with local drive view hidden

Source commit: ba074c49974435f1f0d39f1b79bca0798ecaf49f
Martin Prikryl 4 years ago
parent
commit
2716159a52
1 changed files with 7 additions and 1 deletions
  1. 7 1
      source/forms/ScpCommander.cpp

+ 7 - 1
source/forms/ScpCommander.cpp

@@ -1118,10 +1118,16 @@ void __fastcall TScpCommanderForm::UpdateControls()
     {
       DriveView(osOther)->SetFocus();
     }
-    else
+    else if (LocalDriveView->Visible)
     {
       LocalDriveView->SetFocus();
     }
+    else
+    {
+      // Switching to a disconnected session with local drive view hidden - fallback to the local dir view (should always be visible)
+      DebugAssert(LocalDirView->Visible);
+      LocalDirView->SetFocus();
+    }
   }
 
   if (RemotePathLabel->FocusControl != DirView(osOther))