-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make .ext on empty paths return "" rather than crashing with a NPE (#87)
Fixes com-lihaoyi/Ammonite#1017 This is more consistent with calling `.ext` on non-empty paths which have no extension, since those currently return `""` We also introduce a new a `lastOption` method, as a way to get the last segment in a list without throwing. Not sure if that's the right thing to do, or whether we should make `.last` return `""` (which is otherwise not a valid return value, since path segments cannot be empty). Covered with simple unit tests
- Loading branch information
Showing
3 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters