Browse Source

Fix Greg's NPE in Downloader

Fixes issue 1579

git-svn-id: http://svn.dmdirc.com/trunk@4498 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 years ago
parent
commit
64517d103d
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/com/dmdirc/util/Downloader.java

+ 4
- 2
src/com/dmdirc/util/Downloader.java View File

@@ -159,8 +159,10 @@ public final class Downloader {
159 159
         final InputStream input = urlConn.getInputStream();
160 160
         final int length = urlConn.getContentLength();
161 161
         int current = 0;
162
-        
163
-        listener.setIndeterminate(length == -1);
162
+
163
+        if (listener != null) {
164
+            listener.setIndeterminate(length == -1);
165
+        }
164 166
         
165 167
         final byte[] buffer = new byte[512];
166 168
         int count;

Loading…
Cancel
Save