Merge "Fixing NPE in CursorLoader"
diff --git a/core/java/android/content/CursorLoader.java b/core/java/android/content/CursorLoader.java
index e230394..01bf968 100644
--- a/core/java/android/content/CursorLoader.java
+++ b/core/java/android/content/CursorLoader.java
@@ -50,7 +50,9 @@
     public void deliverResult(Cursor cursor) {
         if (mStopped) {
             // An async query came in while the loader is stopped
-            cursor.close();
+            if (cursor != null) {
+                cursor.close();
+            }
             return;
         }
         mCursor = cursor;