ソースを参照

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;

読み込み中…
キャンセル
保存