Commit 4a0848de authored by Geoffrey Métais's avatar Geoffrey Métais

Check url validity before downloading

(cherry picked from commit 37498246)
parent bc6096b7
...@@ -107,6 +107,8 @@ public class HttpImageLoader implements Callbacks { ...@@ -107,6 +107,8 @@ public class HttpImageLoader implements Callbacks {
Bitmap icon = null; Bitmap icon = null;
try { try {
URL url = new URL(imageUrl); URL url = new URL(imageUrl);
if (url.getPort() <= 0)
return null;
urlConnection = (HttpURLConnection) url.openConnection(); urlConnection = (HttpURLConnection) url.openConnection();
InputStream in = new BufferedInputStream(urlConnection.getInputStream()); InputStream in = new BufferedInputStream(urlConnection.getInputStream());
icon = BitmapFactory.decodeStream(in); icon = BitmapFactory.decodeStream(in);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment