From d6a7ca317ff8ca63e468aaa72818d17211d7476b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Mar 2006 23:47:15 +0000 Subject: [PATCH] don't crash if one of GetAllCommands() parameters is NULL (coverity checker CID 11) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/mimetype.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index e159a60e7e..f9c9d23857 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -1400,13 +1400,17 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, count++; if ( vrb.IsSameAs(wxT("open"))) { - verbs->Insert(vrb, 0u); - commands ->Insert(cmd, 0u); + if ( verbs ) + verbs->Insert(vrb, 0u); + if ( commands ) + commands ->Insert(cmd, 0u); } else { - verbs->Add(vrb); - commands->Add(cmd); + if ( verbs ) + verbs->Add(vrb); + if ( commands ) + commands->Add(cmd); } } } -- 2.45.2