File tree 1 file changed +8
-7
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -56,13 +56,6 @@ public void start(Timer timer) {
56
56
}
57
57
58
58
public synchronized void retriggerDiscovery (boolean polled ) {
59
- while (BaseNoGui .packages == null ) {
60
- try {
61
- Thread .sleep (1000 );
62
- } catch (InterruptedException e ) {
63
- // noop
64
- }
65
- }
66
59
Platform platform = BaseNoGui .getPlatform ();
67
60
if (platform == null ) {
68
61
return ;
@@ -103,6 +96,11 @@ public synchronized void retriggerDiscovery(boolean polled) {
103
96
String [] parts = newPort .split ("_" );
104
97
String port = parts [0 ];
105
98
99
+ if (parts .length != 3 ) {
100
+ // something went horribly wrong
101
+ continue ;
102
+ }
103
+
106
104
Map <String , Object > boardData = platform .resolveDeviceByVendorIdProductId (port , BaseNoGui .packages );
107
105
108
106
BoardPort boardPort = null ;
@@ -168,6 +166,9 @@ public synchronized void retriggerDiscovery(boolean polled) {
168
166
169
167
@ Override
170
168
public void run () {
169
+ if (BaseNoGui .packages == null ) {
170
+ return ;
171
+ }
171
172
retriggerDiscovery (true );
172
173
}
173
174
}
You can’t perform that action at this time.
0 commit comments