1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-19 08:52:15 +01:00

fix NPE if CLI upload is used

This commit is contained in:
Martino Facchin 2017-09-30 13:16:44 +02:00
parent 52c829fb0d
commit 8363831dd4

View File

@ -153,7 +153,9 @@ public class NetworkDiscovery implements Discovery, ServiceListener, Runnable {
@Override @Override
public void stop() { public void stop() {
jmdns.unregisterAllServices(); if (jmdns != null) {
jmdns.unregisterAllServices();
}
// we don't close the JmmDNS instance as it's too slow // we don't close the JmmDNS instance as it's too slow
/* /*
try { try {
@ -162,7 +164,9 @@ public class NetworkDiscovery implements Discovery, ServiceListener, Runnable {
e.printStackTrace(); e.printStackTrace();
} }
*/ */
reachabilityTimer.cancel(); if (reachabilityTimer != null) {
reachabilityTimer.cancel();
}
} }
@Override @Override