Require a non-empty drag image to prevent crash
This commit is contained in:
parent
8ce1930f0d
commit
e683f28e32
2 changed files with 15 additions and 5 deletions
|
@ -1327,9 +1327,17 @@ void WebContents::StartDrag(const mate::Dictionary& item,
|
|||
|
||||
// Error checking.
|
||||
if (icon.IsEmpty()) {
|
||||
args->ThrowError("Must specify 'icon' option");
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
// NSWindow.dragImage requires a non-empty NSImage
|
||||
if (icon->image().IsEmpty()) {
|
||||
args->ThrowError("Must specify non-empty 'icon' option");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Start dragging.
|
||||
if (!files.empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue