mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
NetworkDiscovery was silently failing because packages werenìt ready yet. Fixes #2837
This commit is contained in:
parent
b42c6667e1
commit
40535dfc55
@ -137,7 +137,7 @@ public class NetworkDiscovery implements Discovery, ServiceListener, cc.arduino.
|
||||
}
|
||||
|
||||
String label = name + " at " + address;
|
||||
if (board != null) {
|
||||
if (board != null && BaseNoGui.packages != null) {
|
||||
String boardName = BaseNoGui.getPlatform().resolveDeviceByBoardID(BaseNoGui.packages, board);
|
||||
if (boardName != null) {
|
||||
label += " (" + boardName + ")";
|
||||
|
@ -164,6 +164,8 @@ public class Platform {
|
||||
}
|
||||
|
||||
public String resolveDeviceByBoardID(Map<String, TargetPackage> packages, String boardId) {
|
||||
assert packages != null;
|
||||
assert boardId != null;
|
||||
for (TargetPackage targetPackage : packages.values()) {
|
||||
for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) {
|
||||
for (TargetBoard board : targetPlatform.getBoards().values()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user