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

Commit

Permalink
Merge pull request #450 from adobe/ingo/fix-7752
Browse files Browse the repository at this point in the history
Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752)
  • Loading branch information
RaymondLim committed Aug 20, 2014
2 parents 9e1bae2 + 26795a1 commit 2dd2071
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 2dd2071

Please sign in to comment.