X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32592f4a80846246cdb6ea3463c80cc1a55dfef1..186344760df70193277af236c5faaba33c79d9f9:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index e159a60e7e..f5e986fe99 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -124,6 +124,11 @@ public: if ( idx ) *idx = n; } + else if ( idx ) + { + // different from any valid index + *idx = (size_t)-1; + } return s; } @@ -1400,13 +1405,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); } } }