File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial Expand file tree Collapse file tree 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) {
5656 }
5757
5858 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- }
6659 Platform platform = BaseNoGui .getPlatform ();
6760 if (platform == null ) {
6861 return ;
@@ -103,6 +96,11 @@ public synchronized void retriggerDiscovery(boolean polled) {
10396 String [] parts = newPort .split ("_" );
10497 String port = parts [0 ];
10598
99+ if (parts .length != 3 ) {
100+ // something went horribly wrong
101+ continue ;
102+ }
103+
106104 Map <String , Object > boardData = platform .resolveDeviceByVendorIdProductId (port , BaseNoGui .packages );
107105
108106 BoardPort boardPort = null ;
@@ -168,6 +166,9 @@ public synchronized void retriggerDiscovery(boolean polled) {
168166
169167 @ Override
170168 public void run () {
169+ if (BaseNoGui .packages == null ) {
170+ return ;
171+ }
171172 retriggerDiscovery (true );
172173 }
173174}
You can’t perform that action at this time.
0 commit comments