Skip to content

Commit

Permalink
Fixed recursive stack overflow when setting operator. If division by …
Browse files Browse the repository at this point in the history
…0 was attempted, and the operator was then changed, the app would end up in a recursive loop.
  • Loading branch information
aksel committed Oct 26, 2016
1 parent b3d2d71 commit b34e315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/akseltorgard/devcalc/Calculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void setOperator(Operators.BinaryOperator operator) {
}

//Operator pressed before any digit has been input
else if (mInput == null) {
else if (mInput == null || mInput == 0) {
mOperator = operator;
}

Expand Down

0 comments on commit b34e315

Please sign in to comment.