diff options
Diffstat (limited to 'AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java')
-rw-r--r-- | AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java b/AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java index b42a58a..af6ed56 100644 --- a/AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java +++ b/AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java @@ -412,8 +412,11 @@ public class ByteBufferList { static PriorityQueue<ByteBuffer> reclaimed = new PriorityQueue<ByteBuffer>(8, new Reclaimer()); private static PriorityQueue<ByteBuffer> getReclaimed() { - if (Thread.currentThread() == Looper.getMainLooper().getThread()) - return null; + Looper mainLooper = Looper.getMainLooper(); + if (mainLooper != null) { + if (Thread.currentThread() == mainLooper.getThread()) + return null; + } return reclaimed; } |