Skip to content

Commit 5a9a3ce

Browse files
committed
Fixes chetan#5
Probably needs porting to the new updater framework too ?
1 parent ef14f4c commit 5a9a3ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.IOException;
44
import java.io.InputStream;
55
import java.net.URL;
6+
import java.net.ConnectException;
67

78
import cz.mallat.uasparser.fileparser.PHPFileParser;
89

@@ -60,7 +61,12 @@ private void loadDataFromInternet() throws IOException {
6061
*/
6162
protected String getVersionFromServer() throws IOException {
6263
URL url = new URL(VERSION_CHECK_URL);
63-
InputStream is = url.openStream();
64+
try{
65+
InputStream is = url.openStream();
66+
} catch (ConnectException e) {
67+
return '0';
68+
}
69+
6470
try {
6571
byte[] buff = new byte[4048];
6672
int len = is.read(buff);

0 commit comments

Comments
 (0)