javacommons/utils/src/logger.cpp
branchRCL_3
changeset 71 d5e927d5853b
parent 66 2455ef1f5bbc
child 83 26b2b12093af
--- a/javacommons/utils/src/logger.cpp	Wed Sep 01 12:33:18 2010 +0100
+++ b/javacommons/utils/src/logger.cpp	Tue Sep 14 21:06:50 2010 +0300
@@ -340,14 +340,16 @@
     int logFileNameLen = strlen(fileName);
     TPtr8 fileNamePtr((unsigned char*)fileName, logFileNameLen, logFileNameLen);
     RBuf nameBuf;
-    nameBuf.Create(fileNamePtr.MaxLength());
-    nameBuf.Copy(fileNamePtr);
+    int rc = nameBuf.Create(fileNamePtr.MaxLength());
+    if (rc == KErrNone)
+    {
+        nameBuf.Copy(fileNamePtr);
 
-    TInt len = strlen(txt);
-    TPtr8 ptr((unsigned char*)txt, len, len);
-    RFileLogger::Write(KJavaLogDir, nameBuf, EFileLoggingModeAppendRaw, ptr);
-
-    nameBuf.Close();
+        TInt len = strlen(txt);
+        TPtr8 ptr((unsigned char*)txt, len, len);
+        RFileLogger::Write(KJavaLogDir, nameBuf, EFileLoggingModeAppendRaw, ptr);
+        nameBuf.Close();
+    }
 
 #else //J_LOG_USE_RLOGGER_ENABLED