Skip to content

Commit d3cb014

Browse files
committed
Provide actual string to findPlatform for Optional<Version>
Fix #8034
1 parent 187cfb2 commit d3cb014

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/processing/app/Base.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141

4242
import org.apache.commons.compress.utils.IOUtils;
4343
import org.apache.commons.lang3.StringUtils;
44+
45+
import com.github.zafarkhaja.semver.Version;
46+
4447
import processing.app.debug.TargetBoard;
4548
import processing.app.debug.TargetPackage;
4649
import processing.app.debug.TargetPlatform;
@@ -304,8 +307,9 @@ public Base(String[] args) throws Exception {
304307
String[] boardToInstallParts = parser.getBoardToInstall().split(":");
305308

306309
ContributedPlatform selected = null;
307-
if (boardToInstallParts.length == 3) {
308-
selected = indexer.getIndex().findPlatform(boardToInstallParts[0], boardToInstallParts[1], VersionHelper.valueOf(boardToInstallParts[2]).toString());
310+
if (boardToInstallParts.length == 3 && VersionHelper.valueOf(boardToInstallParts[2]).isPresent()) {
311+
Version vs = VersionHelper.valueOf(boardToInstallParts[2]).get();
312+
selected = indexer.getIndex().findPlatform(boardToInstallParts[0], boardToInstallParts[1], vs.toString());
309313
} else if (boardToInstallParts.length == 2) {
310314
List<ContributedPlatform> platformsByName = indexer.getIndex().findPlatforms(boardToInstallParts[0], boardToInstallParts[1]);
311315
Collections.sort(platformsByName, new DownloadableContributionVersionComparator());

0 commit comments

Comments
 (0)