Browse Source

Bug fix: Failure when using /browse= switch and a file panel is empty

Source commit: a5de116e21e2720220c01613bdb7dfbfaef3fcca
Martin Prikryl 2 years ago
parent
commit
e462686f99
1 changed files with 2 additions and 2 deletions
  1. 2 2
      source/forms/ScpCommander.cpp

+ 2 - 2
source/forms/ScpCommander.cpp

@@ -2665,11 +2665,11 @@ void __fastcall TScpCommanderForm::BrowseFile()
   }
   TScpCommanderConfiguration ScpCommander = WinConfiguration->ScpCommander;
   // Select the panel that has the file, with preference on the remote panel
-  if (RemoteDirView->ItemFocused->Selected)
+  if ((RemoteDirView->ItemFocused != NULL) && RemoteDirView->ItemFocused->Selected)
   {
     ScpCommander.CurrentPanel = osRemote;
   }
-  else if (LocalDirView->ItemFocused->Selected)
+  else if ((LocalDirView->ItemFocused != NULL) && LocalDirView->ItemFocused->Selected)
   {
     ScpCommander.CurrentPanel = osLocal;
   }