Alert on widget update
authorKarol Pawlowski <k.pawlowski@samsung.com>
Thu, 11 Apr 2013 05:18:43 +0000 (07:18 +0200)
committerGerrit Code Review <gerrit2@kim11>
Thu, 11 Apr 2013 11:00:43 +0000 (20:00 +0900)
[Issue#] LINUXWRT-219
[Bug] N/A
[Cause] N/A
[Solution] Remove issues
[Verification] Build wrt-installer

Change-Id: Ibaa5523385597f3827cadd05b290a99fbb3a0030

src/jobs/widget_install/job_widget_install.cpp

index 8579e9a..fe6103f 100644 (file)
@@ -585,6 +585,10 @@ ConfigureResult JobWidgetInstall::checkWidgetUpdate(
     LogInfo("incoming version = '" << update.incomingVersion);
     LogInfo("Tizen AppID = " << update.tzAppId);
 
+    if (update.existingVersion.IsNull() || update.incomingVersion.IsNull()) {
+        return ConfigureResult::Failed;
+    }
+
     // Check running state
     bool isRunning = false;
     int retval =
@@ -769,9 +773,16 @@ WidgetUpdateInfo JobWidgetInstall::detectWidgetUpdate(
     }
 
     WidgetDAOReadOnly dao(tizenId);
+
+    OptionalWidgetVersion optVersion;
+    DPL::OptionalString version = dao.getVersion();
+    if (!version.IsNull()) {
+        optVersion = OptionalWidgetVersion(WidgetVersion(*version));
+    }
+
     return WidgetUpdateInfo(
         dao.getTzAppId(),
-        WidgetVersion(*dao.getVersion()),
+        optVersion,
         incomingVersion);
 }