From ba5606beec10bc6a35f6fa05736ea596f88e08e1 Mon Sep 17 00:00:00 2001
From: Cedric Degea <invalid@invalid.com>
Date: Wed, 9 Apr 2014 23:25:57 +0200
Subject: [PATCH] BOptionPopUp: check for non-NULL Message(). Fixes #10733
---
src/kits/interface/OptionControl.cpp | 2 +-
src/kits/interface/OptionPopUp.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kits/interface/OptionControl.cpp b/src/kits/interface/OptionControl.cpp
index f7e4fa8..add6d36 100644
a
|
b
|
BOptionControl::SelectOptionFor(int32 value)
|
101 | 101 | int32 numOptions = CountOptions(); |
102 | 102 | for (int32 c = 0; c < numOptions; c++) { |
103 | 103 | const char *name = NULL; |
104 | | int32 optionValue; |
| 104 | int32 optionValue = 0; |
105 | 105 | if (GetOptionAt(c, &name, &optionValue) && optionValue == value) { |
106 | 106 | SetValue(optionValue); |
107 | 107 | return B_OK; |
diff --git a/src/kits/interface/OptionPopUp.cpp b/src/kits/interface/OptionPopUp.cpp
index 666c32c..c31650c 100644
a
|
b
|
BOptionPopUp::GetOptionAt(int32 index, const char** outName, int32* outValue)
|
107 | 107 | if (item != NULL) { |
108 | 108 | if (outName != NULL) |
109 | 109 | *outName = item->Label(); |
110 | | if (outValue != NULL) |
| 110 | if (outValue != NULL && item->Message() != NULL) |
111 | 111 | item->Message()->FindInt32("be:value", outValue); |
112 | 112 | |
113 | 113 | result = true; |