From c6ca6d922f8bc785daa18ca7b74354d2baa99606 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 7 Jun 2017 08:09:49 +0200 Subject: [PATCH] analyzer warning: method should never return nil --- src/osx/cocoa/textctrl.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 91ff45b905..8d19af1e56 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -548,7 +548,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; - (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger*)index { - NSMutableArray* matches = NULL; + NSMutableArray* matches = [NSMutableArray array]; wxTextWidgetImpl* impl = (wxNSTextFieldControl * ) wxWidgetImpl::FindFromWXWidget( self ); wxTextEntry * const entry = impl->GetTextEntry(); @@ -563,7 +563,6 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; [[textView string] substringWithRange:charRange] ); - matches = [NSMutableArray array]; for ( ;; ) { const wxString s = completer->GetNext();