Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 2dd2071

Browse files
committed
Merge pull request #450 from adobe/ingo/fix-7752
Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752)
2 parents 9e1bae2 + 26795a1 commit 2dd2071

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

appshell/client_handler.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,13 @@ void ClientHandler::SendOpenFileCommand(CefRefPtr<CefBrowser> browser, const Cef
353353
std::string fileArrayStr(fileArray);
354354
// FIXME: Use SendJSCommand once it supports parameters
355355
std::string cmd = "require('command/CommandManager').execute('file.openDroppedFiles'," + fileArrayStr + ")";
356-
browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),
356+
357+
// if files are droppend and the Open Dialog is visible, then browser is NULL
358+
// This fixes https://github.com/adobe/brackets/issues/7752
359+
if (browser) {
360+
browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),
357361
browser->GetMainFrame()->GetURL(), 0);
362+
}
358363
}
359364

360365
void ClientHandler::DispatchCloseToNextBrowser()

0 commit comments

Comments
 (0)