iaupdate/IAD/engine/controller/src/iaupdateutils.cpp
branchRCL_3
changeset 27 e8965914fac7
parent 26 8b7f4e561641
--- a/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -302,7 +302,7 @@
 // -----------------------------------------------------------------------------
 
 EXPORT_C TBool IAUpdateUtils::IsWidgetInstalledL(const TDesC& aIdentifier, TIAUpdateVersion& aVersion )
-    {
+    { 
     RWidgetRegistryClientSession widgetRegistry;
 
     User::LeaveIfError( widgetRegistry.Connect() );
@@ -317,15 +317,29 @@
         {
         CWidgetInfo* widgetInfo( widgetInfoArr[i] );  
         
-        CWidgetPropertyValue* BundleId = widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleIdentifier );
+        CWidgetPropertyValue* BundleId = 
+                widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleIdentifier );
         CleanupStack::PushL( BundleId );
         
         if( aIdentifier.Compare( *(BundleId->iValue.s) )== 0 )
             {
-            CWidgetPropertyValue* version = widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleVersion );
+            // Get version
+            CWidgetPropertyValue* version = 
+                    widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleVersion );
             CleanupStack::PushL( version );
             
-            DesToVersionL(*(version->iValue.s), aVersion.iMajor, aVersion.iMinor, aVersion.iBuild );
+            // Convert version
+            if (version->iValue.s)
+                {
+                DesToVersionL(*(version->iValue.s), aVersion.iMajor, aVersion.iMinor, aVersion.iBuild );
+                }
+            else
+                {
+                // version does not exist, set default (0.0.1)
+                aVersion.iMajor = 0;
+                aVersion.iMinor = 0;
+                aVersion.iBuild = 1;
+                }
             
             CleanupStack::PopAndDestroy( version );
             CleanupStack::PopAndDestroy( BundleId );