Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f00a95d authored by Annie Chin's avatar Annie Chin
Browse files

Null-check result string.

Bug: 34801142
Change-Id: I1c464ea92c1a7698c81e515159173f6284d127de
parent 13cd100e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1531,7 +1531,9 @@ public class Evaluator implements CalculatorExpr.ExprResolver {
        final String rs = ei.mResultString;
        // An error can occur here only under extremely unlikely conditions.
        // Check anyway, and just refuse.
        if (ei.mResultString == ERRONEOUS_RESULT) {
        // rs *should* never be null, but it happens. Check as a workaround to protect against
        // crashes until we find the root cause (b/34801142)
        if (rs == ERRONEOUS_RESULT || rs == null) {
            return null;
        }
        final int dotIndex = rs.indexOf('.');