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

Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752) #450

Merged
merged 4 commits into from
Aug 20, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion appshell/client_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,13 @@ void ClientHandler::SendOpenFileCommand(CefRefPtr<CefBrowser> browser, const Cef
std::string fileArrayStr(fileArray);
// FIXME: Use SendJSCommand once it supports parameters
std::string cmd = "require('command/CommandManager').execute('file.openDroppedFiles'," + fileArrayStr + ")";
browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),

// if files are droppend and the Open Dialog is visible, then browser is NULL
// This fixes https://github.com/adobe/brackets/issues/7752
if (browser) {
browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),
browser->GetMainFrame()->GetURL(), 0);
}
}

void ClientHandler::DispatchCloseToNextBrowser()
Expand Down