Skip to content

Commit 65e7e2c

Browse files
committed
fix. 문자열이 비어있는지 검증하기 전 커스텀 구분자 파싱으로 발생하는 문제 해결
1 parent 682929a commit 65e7e2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/domain/StringCalculator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ public class StringCalculator {
99

1010
public int calculate(String str) {
1111
String[] tokens;
12-
String customDelimeter = findCustomDelimeter(str);
12+
String customDelimeter;
1313

1414
if (str == null || str.isBlank()) {
1515
throw new RuntimeException("문자열이 비어있습니다.");
1616
}
1717

18+
customDelimeter = findCustomDelimeter(str);
19+
1820
if (customDelimeter == null) {
1921
tokens = str.split(delimeterRegex);
2022
} else {

0 commit comments

Comments
 (0)