Fix invalid version detection (#1116)

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1116
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
qwerty287 2022-04-30 13:47:15 +02:00 committed by M M Arif
parent 269f1fb32b
commit 685844d41f
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ public class Version {
final Pattern patternNumberDotNumber = Pattern.compile("^\\d+(\\.(\\d)+)*");
if(!valid(raw) || raw.equals("main")) {
if(!valid(raw)) {
throw new IllegalArgumentException("Invalid version format: " + raw);
}
if(raw.equals("main")) {
dev = true;
values = new ArrayList<>();
return;