* fix for NPE in version string comparison

This commit is contained in:
Grahame Grieve 2020-11-11 10:11:40 +11:00
parent 4e602b07e9
commit f23114f901
2 changed files with 7 additions and 0 deletions

View File

@ -465,6 +465,7 @@ public class SnapShotGenerationTests {
fp.setHostServices(context);
messages = new ArrayList<ValidationMessage>();
System.out.println("---- "+id+" -----------------------------------------");
if (test.isFail()) {
boolean failed = true;
try {

View File

@ -229,8 +229,14 @@ public class VersionUtilities {
* @return Is {@literal current} later or equal to {@literal test}? For example, if <code>this = 0.5</code> and <code>current = 0.6</code> this method will return true
*/
public static boolean isThisOrLater(String test, String current) {
if (test == null || current == null) {
return false;
}
String t = getMajMin(test);
String c = getMajMin(current);
if (t == null || c == null) {
return false;
}
if (c.compareTo(t) == 0) {
return isMajMinOrLaterPatch(test, current);
}