From 52065c26ed71fb8c8b423b56a05f95d5b7c3ded2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 11 Jun 2018 14:51:10 +0200 Subject: [PATCH] [calculation] When the output text overflowed the buffer, parsing the text returns nullptr. Handle this case here --- apps/calculation/calculation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/calculation/calculation.cpp b/apps/calculation/calculation.cpp index 16f8a180e..16ed91733 100644 --- a/apps/calculation/calculation.cpp +++ b/apps/calculation/calculation.cpp @@ -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; }