Commit 24c96bd0 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

MacViews: exit early when trying to drag without a drag image instead of crashing on Mojave

This is a temporary patch to merge back to 69 while we figure out the root cause.

Bug: 876201
Change-Id: Id87ac81f16b1cd3102c8605691421e8bc53dc401
Reviewed-on: https://chromium-review.googlesource.com/1183991Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585001}
parent 47ee391e
......@@ -104,6 +104,12 @@ void DragDropClientMac::StartDragAndDrop(
NSImage* image = gfx::NSImageFromImageSkiaWithColorSpace(
provider.GetDragImage(), base::mac::GetSRGBColorSpace());
// TODO(crbug/876201): This shouldn't happen. When a repro for this
// is identified and the bug is fixed, change the early return to
// a DCHECK.
if (!image || NSEqualSizes([image size], NSZeroSize))
return;
base::scoped_nsobject<NSPasteboardItem> item([[NSPasteboardItem alloc] init]);
[item setDataProvider:data_source_.get()
forTypes:provider.GetAvailableTypes()];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment