Skip to content

Commit

Permalink
Trim version strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
LunNova committed Mar 4, 2016
1 parent 1f956c0 commit 150a59b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/me/nallar/modpatcher/ModPatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ static class Version implements Comparable<Version> {
private Version(String version) {
if (version == null)
throw new IllegalArgumentException("Version can not be null");
version = version.trim();
if (!version.matches("[0-9]+(\\.[0-9]+)*"))
throw new IllegalArgumentException("Invalid version format");
throw new IllegalArgumentException("Invalid version format. Should consist entirely of digits and dots. Got '" + version + "'");
this.version = version;
}

Expand Down

0 comments on commit 150a59b

Please sign in to comment.