fix insane NPE

java.lang.NullPointerException: println needs a message
 at android.util.Log.println_native(Native Method)
 at android.util.Log.e(Log.java:232)
 at org.fdroid.fdroid.net.DownloaderService.handleIntent(DownloaderService.java:232)
 at org.fdroid.fdroid.net.DownloaderService.access$000(DownloaderService.java:88)
 at org.fdroid.fdroid.net.DownloaderService$ServiceHandler.handleMessage(DownloaderService.java:108)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:148)
 at android.os.HandlerThread.run(HandlerThread.java:61)
This commit is contained in:
Hans-Christoph Steiner 2019-04-09 14:10:50 +02:00
parent 66e909d606
commit 593ce5284c
3 changed files with 3 additions and 3 deletions

View File

@ -276,7 +276,7 @@ public class WifiStateChangeService extends IntentService {
if (BuildConfig.DEBUG) {
e.printStackTrace();
} else {
Log.i(TAG, e.getLocalizedMessage());
Log.i(TAG, "Getting subnet failed: " + e.getLocalizedMessage());
}
}
}

View File

@ -69,7 +69,7 @@ public class AddRepoIntentService extends IntentService {
try {
urlString = normalizeUrl(uri);
} catch (URISyntaxException e) {
Log.i(TAG, e.getLocalizedMessage());
Log.i(TAG, "Bad URI: " + e.getLocalizedMessage());
return;
}

View File

@ -248,7 +248,7 @@ public class DownloaderService extends Service {
| SSLHandshakeException | SSLKeyException | SSLPeerUnverifiedException | SSLProtocolException
| ProtocolException | UnknownHostException e) {
// if the above list of exceptions changes, also change it in IndexV1Updater.update()
Log.e(TAG, e.getLocalizedMessage());
Log.e(TAG, "CONNECTION_FAILED: " + e.getLocalizedMessage());
sendBroadcast(uri, Downloader.ACTION_CONNECTION_FAILED, localFile, repoId, canonicalUrl);
} catch (IOException e) {
e.printStackTrace();