Merge "libril: Protect against NULL unsolicited response function"
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 514ac90..fbf7ee0 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -792,9 +792,11 @@
         assert(rwlockRet == 0);
     }
 
-    ret = s_unsolResponses[unsolResponseIndex].responseFunction(
-            (int) soc_id, responseType, 0, RIL_E_SUCCESS, const_cast<void*>(data),
-            datalen);
+    if (s_unsolResponses[unsolResponseIndex].responseFunction) {
+        ret = s_unsolResponses[unsolResponseIndex].responseFunction(
+                (int) soc_id, responseType, 0, RIL_E_SUCCESS, const_cast<void*>(data),
+                datalen);
+    }
 
     rwlockRet = pthread_rwlock_unlock(radioServiceRwlockPtr);
     assert(rwlockRet == 0);