Skip to content

Add check to ensure value isn't empty#1319

Merged
tylerbenson merged 1 commit into
masterfrom
tyler/fix-array-out-of-bounds
Mar 18, 2020
Merged

Add check to ensure value isn't empty#1319
tylerbenson merged 1 commit into
masterfrom
tyler/fix-array-out-of-bounds

Conversation

@tylerbenson
Copy link
Copy Markdown
Contributor

@tylerbenson tylerbenson commented Mar 13, 2020

Otherwise split on an empty string may return an empty array.

Otherwise split on an empty string will return an empty array.
@tylerbenson tylerbenson requested a review from a team as a code owner March 13, 2020 22:06
@tylerbenson tylerbenson merged commit 42e3086 into master Mar 18, 2020
@tylerbenson tylerbenson deleted the tyler/fix-array-out-of-bounds branch March 18, 2020 16:52
@randomanderson randomanderson added this to the 0.47.0 milestone Mar 23, 2020
tylerbenson added a commit that referenced this pull request Apr 7, 2020
Turns out the issue wasn't with an empty string returning an empty array, but a string with just `,`.
```
jshell> ",".split(",")
$1 ==> String[0] {  }
```
A non-intuitive edge case in my opinion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants