Skip to content

Commit

Permalink
Fixed another exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pylerSM authored Aug 27, 2016
1 parent 5f75033 commit 62bb599
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;

import javax.xml.parsers.ParserConfigurationException;
Expand Down Expand Up @@ -51,8 +53,10 @@ public Update parse() {

private InputStream getInputStream() {
try {
return rssUrl.openConnection().getInputStream();
} catch (FileNotFoundException | UnknownHostException e) {
URLConnection connection = rssUrl.openConnection();
if (connection == null) return null;
return connection.getInputStream();
} catch (FileNotFoundException | UnknownHostException | ConnectException e) {
Log.e("AppUpdater", "The XML updater file is invalid or is down. AppUpdate can't check for updates.");
return null;
} catch (IOException e) {
Expand Down

0 comments on commit 62bb599

Please sign in to comment.