[calculation] When the output text overflowed the buffer, parsing the

text returns nullptr. Handle this case here
This commit is contained in:
Émilie Feral
2018-06-11 14:51:10 +02:00
committed by LeaNumworks
parent 217d0ccc10
commit 52065c26ed

View File

@@ -149,6 +149,9 @@ Expression * Calculation::exactOutput(Context * context) {
* 'sqrt(2)/2 = 0.999906' (which is totally wrong) instead of
* 'cos(pi/4) = 0.999906' (which is true in degree). */
m_exactOutput = Expression::parse(m_exactOutputText);
if (m_exactOutput == nullptr) {
m_exactOutput = new Undefined();
}
}
return m_exactOutput;
}