Commit d1c3aac0 authored by David Faure's avatar David Faure
Browse files

Fix crash in simplifiedExpression for a null expression

parent 4fad9c6d
Pipeline #56598 passed with stage
in 22 seconds
...@@ -454,6 +454,8 @@ private Q_SLOTS: ...@@ -454,6 +454,8 @@ private Q_SLOTS:
OpeningHours oh(expression); OpeningHours oh(expression);
QCOMPARE(oh.error(), error); QCOMPARE(oh.error(), error);
(void)oh.normalizedExpression(); // don't crash
(void)oh.simplifiedExpression(); // don't crash
} }
}; };
......
...@@ -123,7 +123,7 @@ void OpeningHoursPrivate::autocorrect() ...@@ -123,7 +123,7 @@ void OpeningHoursPrivate::autocorrect()
void OpeningHoursPrivate::simplify() void OpeningHoursPrivate::simplify()
{ {
if (m_error == OpeningHours::SyntaxError) { if (m_error == OpeningHours::SyntaxError || m_rules.empty()) {
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment