rules must never be null

if rules were null, it was pointing to a local structure, prabably a
crash after leaving if rules where used.

REVIEW: 102057
remotes/origin/Plasma/5.0
Jaime Torres 15 years ago
parent 16bcfb0114
commit 646954ed9d
  1. 5
      kcmkwin/kwinrules/ruleswidget.cpp

@ -384,8 +384,9 @@ static NET::WindowType comboToType(int val)
void RulesWidget::setRules(Rules* rules)
{
Rules tmp;
if (rules == NULL)
rules = &tmp; // empty
Q_ASSERT( rules );
description->setText(rules->description);
wmclass->setText(rules->wmclass);
whole_wmclass->setChecked(rules->wmclasscomplete);

Loading…
Cancel
Save