Cope when CRepository::NewL fails - fix for bug 2895 RCL_3
authorWilliam Roberts <williamr@symbian.org>
Tue, 08 Jun 2010 14:20:19 +0100
branchRCL_3
changeset 29 0561add730c4
parent 28 93cfe064caa0
child 30 df3437164f86
Cope when CRepository::NewL fails - fix for bug 2895
javauis/lcdui_akn/lcdui/src/CMIDKeyDecoder.cpp
--- a/javauis/lcdui_akn/lcdui/src/CMIDKeyDecoder.cpp	Mon Jun 07 17:20:25 2010 +0100
+++ b/javauis/lcdui_akn/lcdui/src/CMIDKeyDecoder.cpp	Tue Jun 08 14:20:19 2010 +0100
@@ -222,9 +222,12 @@
     TRAP(err, repository = CRepository::NewL(KCRUidMidpLcdui));
     // 2 bytes in scan code
     TBuf8<2> scanCodeBuffer;
-    CleanupStack::PushL(repository);
-    err = repository->Get(KAdditionalSelectKeyMapping,scanCodeBuffer);
-    CleanupStack::PopAndDestroy(repository);
+    if (err == KErrNone)
+    {
+        CleanupStack::PushL(repository);
+        err = repository->Get(KAdditionalSelectKeyMapping,scanCodeBuffer);
+        CleanupStack::PopAndDestroy(repository);
+    }
     if (err == KErrNone)
     {
         TUint8 scanCodeLeft = scanCodeBuffer[0];