mirror of
https://github.com/sparrowwallet/drongo.git
synced 2025-11-05 11:56:38 +00:00
strip non-numeric trailing version info
This commit is contained in:
parent
342c85a39e
commit
ca758e1288
1 changed files with 1 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ public class Version implements Comparable<Version> {
|
||||||
if(version == null) {
|
if(version == null) {
|
||||||
throw new IllegalArgumentException("Version can not be null");
|
throw new IllegalArgumentException("Version can not be null");
|
||||||
}
|
}
|
||||||
|
version = version.replaceAll("[^0-9.].*", "");
|
||||||
if(!version.matches("[0-9]+(\\.[0-9]+)*")) {
|
if(!version.matches("[0-9]+(\\.[0-9]+)*")) {
|
||||||
throw new IllegalArgumentException("Invalid version format");
|
throw new IllegalArgumentException("Invalid version format");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue