commsfwutils/commsbufs/src/commsbufasyncrequest.cpp
changeset 32 d2396c80c344
parent 0 dfb7c4ff071f
--- a/commsfwutils/commsbufs/src/commsbufasyncrequest.cpp	Mon May 24 18:38:45 2010 +0100
+++ b/commsfwutils/commsbufs/src/commsbufasyncrequest.cpp	Mon May 24 18:44:15 2010 +0100
@@ -76,7 +76,8 @@
 @param  aAllocator      The handle to the allocator
 */
     {
-    iAsyncReqImpl->Alloc(aChain, aSize, aMinSize, aMaxSize, aStatus);
+    __ASSERT_ALWAYS(iAsyncReqImpl != NULL, CommsBuf::Panic(EMBuf_InvalidAsyncReqImpl));
+	iAsyncReqImpl->Alloc(aChain, aSize, aMinSize, aMaxSize, aStatus);
     }
 
 
@@ -85,7 +86,10 @@
 Cancel the asynchronous request
 */
 	{
-	iAsyncReqImpl->Cancel();
+	if (iAsyncReqImpl)
+		{
+		iAsyncReqImpl->Cancel();
+		}
 	}
 
 EXPORT_C void RCommsBufAsyncRequest::Complete(TInt aCode)
@@ -95,5 +99,6 @@
 @param	aCode	The request completion code
 */
 	{
+	__ASSERT_ALWAYS(iAsyncReqImpl != NULL, CommsBuf::Panic(EMBuf_InvalidAsyncReqImpl));
 	iAsyncReqImpl->Complete(aCode);
 	}