Ticket #10733: 0001_2-BOptionPopUp-check-for-non-NULL-Message.patch

File 0001_2-BOptionPopUp-check-for-non-NULL-Message.patch, 879 bytes (added by ttcoder, 11 years ago)

Version 2 (consistent with SetValue(), which checks for Message() at the same early stage too).

  • src/kits/interface/OptionPopUp.cpp

    From 4dd7b928ea912fa4912084dfe5f89a14bc970d3c Mon Sep 17 00:00:00 2001
    From: Cedric Degea <invalid@invalid.com>
    Date: Wed, 9 Apr 2014 23:33:59 +0200
    Subject: [PATCH] BOptionPopUp: check for non-NULL Message().
    
    Fixes #10733
    ---
     src/kits/interface/OptionPopUp.cpp |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/kits/interface/OptionPopUp.cpp b/src/kits/interface/OptionPopUp.cpp
    index c31650c..4b1c2b7 100644
    a b BOptionPopUp::GetOptionAt(int32 index, const char** outName, int32* outValue)  
    104104
    105105    if (menu != NULL) {
    106106        BMenuItem* item = menu->ItemAt(index);
    107         if (item != NULL) {
     107        if (item != NULL && item->Message() != NULL) {
    108108            if (outName != NULL)
    109109                *outName = item->Label();
    110110            if (outValue != NULL && item->Message() != NULL)