Skip to content

Commit 4a043ae

Browse files
committed
hotfix
1 parent b9c6cda commit 4a043ae

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/com/falsepattern/lib/api/SemanticVersion.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ public SemanticVersion(int majorVersion, int minorVersion, int patchVersion, Str
2424
this.majorVersion = majorVersion;
2525
this.minorVersion = minorVersion;
2626
this.patchVersion = patchVersion;
27-
preRelease = preRelease.trim();
28-
build = build.trim();
27+
preRelease = preRelease == null ? null : preRelease.trim();
28+
build = build == null ? null : build.trim();
2929
this.preRelease = "".equals(preRelease) ? null : preRelease;
3030
this.build = "".equals(build) ? null : build;
3131
}
3232

33+
public SemanticVersion(int majorVersion, int minorVersion, int patchVersion, String preRelease) {
34+
this(majorVersion, minorVersion, patchVersion, preRelease, null);
35+
}
36+
37+
public SemanticVersion(int majorVersion, int minorVersion, int patchVersion) {
38+
this(majorVersion, minorVersion, patchVersion, null, null);
39+
}
40+
3341
@Override
3442
public int compareTo(@NonNull Version o) {
3543
if (o instanceof ComplexVersion) {

0 commit comments

Comments
 (0)