소스 검색

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

Source commit: a5de116e21e2720220c01613bdb7dfbfaef3fcca
Martin Prikryl 2 년 전
부모
커밋
e462686f99
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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;
   TScpCommanderConfiguration ScpCommander = WinConfiguration->ScpCommander;
   // Select the panel that has the file, with preference on the remote panel
   // 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;
     ScpCommander.CurrentPanel = osRemote;
   }
   }
-  else if (LocalDirView->ItemFocused->Selected)
+  else if ((LocalDirView->ItemFocused != NULL) && LocalDirView->ItemFocused->Selected)
   {
   {
     ScpCommander.CurrentPanel = osLocal;
     ScpCommander.CurrentPanel = osLocal;
   }
   }