浏览代码

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;
   // 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;
   }