Skip to content

Commit

Permalink
libdeng2|IndirectRule: If no source set, evaluate to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 18, 2013
1 parent e2419ef commit 66abb5f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions doomsday/libdeng2/src/widgets/indirectrule.cpp
Expand Up @@ -41,10 +41,7 @@ void IndirectRule::setSource(Rule const &rule)

void IndirectRule::update()
{
if(_source)
{
setValue(_source->value());
}
setValue(_source? _source->value() : 0);
}

Rule const &IndirectRule::source() const
Expand All @@ -55,7 +52,14 @@ Rule const &IndirectRule::source() const

String IndirectRule::description() const
{
return String("Indirect => ") + source().description();
if(_source)
{
return String("Indirect => ") + source().description();
}
else
{
return String("Indirect => NULL");
}
}

} // namespace de

0 comments on commit 66abb5f

Please sign in to comment.