浏览代码

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 年前
父节点
当前提交
64517d103d
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      src/com/dmdirc/util/Downloader.java

+ 4
- 2
src/com/dmdirc/util/Downloader.java 查看文件

@@ -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;

正在加载...
取消
保存