Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-01-26 22:10:59 +0000
committerStijn Buys <ingar@osirion.org>2009-01-26 22:10:59 +0000
commita23fc212ef40acf1ec9ea364e4773d7eb19c5462 (patch)
tree026ee33f4b1b2857487176f467996dbc5096520a
parentc99a440e6fb1edf35e280f4df8ba22600e490535 (diff)
fix NULL pointer segfault
-rw-r--r--src/ui/widget.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/widget.cc b/src/ui/widget.cc
index ef5d472..15fa10f 100644
--- a/src/ui/widget.cc
+++ b/src/ui/widget.cc
@@ -171,13 +171,18 @@ void Widget::set_background(bool background)
void Widget::set_label(std::string const & label)
{
- set_label(label.c_str());
+ widget_label.assign(label);
+ aux::to_label(widget_label);
}
void Widget::set_label(char const *label)
{
- widget_label.assign(label);
- aux::to_label(widget_label);
+ if (label) {
+ widget_label.assign(label);
+ aux::to_label(widget_label);
+ } else {
+ widget_label.clear();
+ }
}
void Widget::set_palette(const Palette *palette)