usbuis/usbuinotif/src/usbuinotifotgerror.cpp
branchRCL_3
changeset 6 a15c582fbf97
parent 4 7e15987c4500
child 7 ff9df6630274
--- a/usbuis/usbuinotif/src/usbuinotifotgerror.cpp	Fri Feb 19 23:50:33 2010 +0200
+++ b/usbuis/usbuinotif/src/usbuinotifotgerror.cpp	Fri Mar 12 15:48:40 2010 +0200
@@ -108,22 +108,29 @@
         {
         User::Leave( KErrInUse );
         }
-
-    iMessage = aMessage;
-    iNeedToCompleteMessage = ETrue;
-    iReplySlot = aReplySlot;
-
+        
     // Get parameters 
     //
-    iErrorId = 0;
+    
     TPckgC<TInt> pckg( iErrorId );
     pckg.Set( aBuffer );
     iErrorId = pckg();
-
+    
+    FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL iErrorId: %d"), iErrorId ));  
+    if ( iErrorId < 0 || iErrorId >= iStringIds.Count() )
+        {        
+        User::Leave( KErrArgument);        
+        }    
+        
+    iMessage = aMessage;
+    iNeedToCompleteMessage = ETrue;
+    iReplySlot = aReplySlot;  
+	  
     SetActive();
     iStatus = KRequestPending;
     TRequestStatus* stat = &iStatus;
-    User::RequestComplete( stat, KErrNone );
+    User::RequestComplete( stat, KErrNone );    
+        
     FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL() completed"));
     }