mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
Handle invalid versions without NullPointerExceptions
This commit is contained in:
parent
d20e608623
commit
e0b2cd0ffe
@ -899,10 +899,14 @@ public class BaseNoGui {
|
||||
PreferencesData.set(prefix + toolName + "-" + toolVersion + ".path", toolPath);
|
||||
PreferencesData.set(prefix + tool.getPackager() + "-" + toolName + "-" + toolVersion + ".path", toolPath);
|
||||
// In the generic tool property put the path of the latest version if more are available
|
||||
try {
|
||||
if (!latestVersions.containsKey(toolName) || comparator.greaterThan(toolVersion, latestVersions.get(toolName))) {
|
||||
latestVersions.put(toolName, toolVersion);
|
||||
PreferencesData.set(prefix + toolName + ".path", toolPath);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Ignore invalid versions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user