Skip to content

Commit

Permalink
R2js: Fix little error in if/else function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas CHABALIER committed Mar 27, 2024
1 parent 8d44c94 commit e4e1e0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/math/R/AbstractR2jsSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ private static String addIfElseBrackets(String expr) {

boolean dontCloseBrack = false;

if (elseIndex >= 0) {
if (elseIndex > 0) {
String ifStatement = result.substring(endIndex + 1, elseIndex).trim();
boolean addIfBrackets = !ifStatement.startsWith("{");
if(addIfBrackets) ifSb.append("{");
Expand Down

0 comments on commit e4e1e0b

Please sign in to comment.