Skip to content

Commit

Permalink
fix: null strings are converted to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
yusshu committed Dec 27, 2023
1 parent bd7044c commit 81ccbf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/team/unnamed/mocha/runtime/value/Value.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
return NumberValue.of(_double);
}

static @NotNull Value of(final @NotNull String string) {
return StringValue.of(string);
static @NotNull Value of(final @Nullable String string) {
return string == null ? nil() : StringValue.of(string);
}

static @NotNull Value nil() {
Expand Down

0 comments on commit 81ccbf9

Please sign in to comment.