From f6a9165dd4cef0f2bd440eeeeca1a30f193c3f10 Mon Sep 17 00:00:00 2001 From: PaulStoffregen Date: Sat, 25 Aug 2018 03:56:19 -0700 Subject: [PATCH] Gracefully handle libraries having unparsable version info --- arduino-core/src/processing/app/packages/UserLibrary.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arduino-core/src/processing/app/packages/UserLibrary.java b/arduino-core/src/processing/app/packages/UserLibrary.java index ee9c0bd031b..29c77e2f228 100644 --- a/arduino-core/src/processing/app/packages/UserLibrary.java +++ b/arduino-core/src/processing/app/packages/UserLibrary.java @@ -149,6 +149,10 @@ public static UserLibrary create(UserLibraryFolder libFolderDesc) throws IOExcep String declaredVersion = properties.get("version").trim(); Version version = VersionHelper.valueOf(declaredVersion); + if (version == null) { + System.err.println("Can't parse library version in " + propertiesFile.toString()); + version = VersionHelper.valueOf("0.0.1"); // version must not be null + } UserLibrary res = new UserLibrary(); res.installedFolder = libFolder;