aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2024-09-18 08:11:28 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2024-09-18 08:11:28 +1000
commit914f855427fa9fedf585ef835a5700cf0426b002 (patch)
tree2493d27ccfe2d3a7d43976851bb89536b7577e23
parent5977b000998149b60a80fa4bb779a663078b951a (diff)
downloadscintilla-mirror-914f855427fa9fedf585ef835a5700cf0426b002.tar.gz
Fix potential NULL use and avoid warning.
-rw-r--r--cocoa/ScintillaCocoa.mm3
1 files changed, 2 insertions, 1 deletions
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];