Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
KOpeningHours
Commits
d1c3aac0
Commit
d1c3aac0
authored
Mar 21, 2021
by
David Faure
Browse files
Fix crash in simplifiedExpression for a null expression
parent
4fad9c6d
Pipeline
#56598
passed with stage
in 22 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
autotests/parsertest.cpp
View file @
d1c3aac0
...
...
@@ -454,6 +454,8 @@ private Q_SLOTS:
OpeningHours
oh
(
expression
);
QCOMPARE
(
oh
.
error
(),
error
);
(
void
)
oh
.
normalizedExpression
();
// don't crash
(
void
)
oh
.
simplifiedExpression
();
// don't crash
}
};
...
...
src/lib/openinghours.cpp
View file @
d1c3aac0
...
...
@@ -123,7 +123,7 @@ void OpeningHoursPrivate::autocorrect()
void
OpeningHoursPrivate
::
simplify
()
{
if
(
m_error
==
OpeningHours
::
SyntaxError
)
{
if
(
m_error
==
OpeningHours
::
SyntaxError
||
m_rules
.
empty
()
)
{
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment