Skip to content

Commit

Permalink
Multicast DNS: state exception fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Apr 5, 2017
1 parent 175e539 commit d3c921c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/main/java/com/eveningoutpost/dexdrip/utils/Mdns.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ public void run() {
}
}
UserError.Log.d(TAG, "Shutting down");
mNsdManager.stopServiceDiscovery(mDiscoveryListener);
try {
mNsdManager.stopServiceDiscovery(mDiscoveryListener);
} catch (IllegalArgumentException | IllegalStateException e) {
UserError.Log.e(TAG, "Could not stop timed service discovery: " + e);
}
hunt_running = false;
JoH.releaseWakeLock(wl);
}
Expand Down Expand Up @@ -263,7 +267,7 @@ public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {
try {
mNsdManager.stopServiceDiscovery(mDiscoveryListener);
} catch (Exception e) {
UserError.Log.d(TAG, "Failed top stop service discovery on failure: " + e);
UserError.Log.d(TAG, "Failed to stop service discovery on failure: " + e);
}
outstanding.decrementAndGet();
locked_until = 0;
Expand Down

0 comments on commit d3c921c

Please sign in to comment.