From 914f855427fa9fedf585ef835a5700cf0426b002 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Wed, 18 Sep 2024 08:11:28 +1000 Subject: Fix potential NULL use and avoid warning. --- cocoa/ScintillaCocoa.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 8419a4157..b1e242cc9 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1516,7 +1516,8 @@ void ScintillaCocoa::StartDrag() { CGImageRelease(imagePixmap); NSImage *image = [[NSImage alloc] initWithSize: selectionRectangle.size]; - [image addRepresentation: bitmap]; + if (bitmap) + [image addRepresentation: bitmap]; NSImage *dragImage = [[NSImage alloc] initWithSize: selectionRectangle.size]; dragImage.backgroundColor = [NSColor clearColor]; -- cgit v1.2.3