diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2013-02-07 13:36:17 +1100 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-02-07 13:36:17 +1100 |
commit | 732796abe45c95b88d091b875f855e331b7839f2 (patch) | |
tree | 2fdd3b76e65e91bf066a9dff3f90f9c634eee151 | |
parent | baa5aee03d0e4c1ecc900e779eed89496fd33d5e (diff) | |
download | scintilla-mirror-732796abe45c95b88d091b875f855e331b7839f2.tar.gz |
Fix crash that can occur after running "Convert to Modern Objective-C Syntax"
which leads to an NSArray that contains nil.
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 7e9823762..36ddd9124 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1351,10 +1351,10 @@ void ScintillaCocoa::SetPasteboardData(NSPasteboard* board, const SelectionText reinterpret_cast<const UInt8 *>(selectedText.s), selectedText.len-1, encoding, false); - [board declareTypes:[NSArray arrayWithObjects: - NSStringPboardType, - selectedText.rectangular ? ScintillaRecPboardType : nil, - nil] owner:nil]; + NSArray *pbTypes = selectedText.rectangular ? + [NSArray arrayWithObjects: NSStringPboardType, ScintillaRecPboardType, nil] : + [NSArray arrayWithObjects: NSStringPboardType, nil]; + [board declareTypes:pbTypes owner:nil]; if (selectedText.rectangular) { |