Skip to content

Commit 8363831

Browse files
committed
fix NPE if CLI upload is used
1 parent 52c829f commit 8363831

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ public void start() {
153153

154154
@Override
155155
public void stop() {
156-
jmdns.unregisterAllServices();
156+
if (jmdns != null) {
157+
jmdns.unregisterAllServices();
158+
}
157159
// we don't close the JmmDNS instance as it's too slow
158160
/*
159161
try {
@@ -162,7 +164,9 @@ public void stop() {
162164
e.printStackTrace();
163165
}
164166
*/
165-
reachabilityTimer.cancel();
167+
if (reachabilityTimer != null) {
168+
reachabilityTimer.cancel();
169+
}
166170
}
167171

168172
@Override

0 commit comments

Comments
 (0)