webservices/wsstar/wsstarplugin/src/wsstarplugin.cpp
changeset 23 a1df79fa35b4
parent 1 272b002df977
--- a/webservices/wsstar/wsstarplugin/src/wsstarplugin.cpp	Fri Apr 16 16:07:50 2010 +0300
+++ b/webservices/wsstar/wsstarplugin/src/wsstarplugin.cpp	Fri Jun 11 14:42:58 2010 +0300
@@ -754,7 +754,7 @@
     TInt count = iMsgHandlers.Count();
     for(TInt i=0;i<count; i++)
         {
-        if (iMsgHandlers[i]->Name() == aCue)
+        if( iMsgHandlers[i] && (iMsgHandlers[i]->Name() == aCue) )
             {
             delete iMsgHandlers[i];
             iMsgHandlers.Remove(i);
@@ -764,7 +764,7 @@
     count = iSessionHandlers.Count();
     for(TInt i=0;i<count; i++)
         {
-        if (iSessionHandlers[i]->Name() == aCue)
+        if( iSessionHandlers[i] && (iSessionHandlers[i]->Name() == aCue) )
             {
             delete iSessionHandlers[i];
             iSessionHandlers.Remove(i);
@@ -789,13 +789,15 @@
         {
         CWSStarPolicyHandler* policyHandler = (CWSStarPolicyHandler*)Handler(WSStarConfig::KPolicyValue);
         pSessionValidateCtx = CWSStarSessionContext::NewLC(Manager().XMLReader(), &aPattern, policyHandler);
-        pSessionValidateCtx->Add(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        if(pSessionValidateCtx)
+        	pSessionValidateCtx->Add(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
         ((CWSStarServiceSession*)aRemoteServiceSession)->SetSessionContext(pSessionValidateCtx);
         CleanupStack::Pop(pSessionValidateCtx);
         }
     else
         {
-        pSessionValidateCtx->Update(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
+        if(pSessionValidateCtx)
+        	pSessionValidateCtx->Update(WSStarContextKeys::KServiceSession(), *(MSenRemoteServiceSession*)aRemoteServiceSession);
         }
     TInt error(KErrNone);
     TRAPD(errorL, error = pSTShandler->InvokeL(*pSessionValidateCtx));
@@ -841,9 +843,7 @@
             aErrorMessage = pNotOwnedErrorMsg->AllocL();
             }
         }
-    
-    
-    
+
     if (cberrorL!=KErrNone)
         {
         TLSLOG(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,(_L("CWSStarPlugin::ProcessOutboundValidationL() !!!!leave from validate handler")));
@@ -1051,7 +1051,8 @@
     CSenGuidGen* pGuidGenerator = CSenGuidGen::NewLC();
     delete iDeviceId;
     iDeviceId = NULL;
-    iDeviceId = pGuidGenerator->GetRandomGuid8LC();
+    if(pGuidGenerator)
+    	iDeviceId = pGuidGenerator->GetRandomGuid8LC();
     TPtr8 deviceIdDes = iDeviceId->Des();
     deviceIdDes.LowerCase();
     CleanupStack::Pop(iDeviceId);