Fixed crash issue in case of install prefer-external
authorJihoon Chung <jihoon.chung@samsung.com>
Wed, 24 Apr 2013 05:23:24 +0000 (14:23 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 24 Apr 2013 07:44:09 +0000 (16:44 +0900)
[Issue#] N_SE-36044
[Problem] Unexpected crash is occurred when install-location set
to prefer-external
[Cause] In case of SD card isn't ready, exception is thrown.
During catch and handle exception, callback touch un-initialized
value.
[Solution] Add condition to prevent un-initialize value
[SCMRequest] N/A

Change-Id: I68eb0ccd5d7ee8737e2e89eba563a8d1ccc0342f

src/misc/widget_install_to_external.cpp

index 4f794b6..42bcc4f 100644 (file)
@@ -74,14 +74,15 @@ void WidgetInstallToExt::preInstallation(GList *dirList, int dSize)
 void WidgetInstallToExt::postInstallation(bool status)
 {
     LogDebug("WidgetInstallToExt::postInstallation()");
-    Assert(m_handle);
 
-    if (status) {
-        m_handle->interface.post_install(m_appId.c_str(),
-                                         APP2EXT_STATUS_SUCCESS);
-    } else {
-        m_handle->interface.post_install(m_appId.c_str(),
-                                         APP2EXT_STATUS_FAILED);
+    if (NULL != m_handle) {
+        if (status) {
+            m_handle->interface.post_install(m_appId.c_str(),
+                                             APP2EXT_STATUS_SUCCESS);
+        } else {
+            m_handle->interface.post_install(m_appId.c_str(),
+                                             APP2EXT_STATUS_FAILED);
+        }
     }
 }
 
@@ -102,14 +103,14 @@ void WidgetInstallToExt::preUpgrade(GList *dirList, int dSize)
 void WidgetInstallToExt::postUpgrade(bool status)
 {
     LogDebug("WidgetInstallToExt::postUpgrade()");
-    Assert(m_handle);
-
-    if (status) {
-        m_handle->interface.post_upgrade(m_appId.c_str(),
-                                         APP2EXT_STATUS_SUCCESS);
-    } else {
-        m_handle->interface.post_upgrade(m_appId.c_str(),
-                                         APP2EXT_STATUS_FAILED);
+    if (NULL != m_handle) {
+        if (status) {
+            m_handle->interface.post_upgrade(m_appId.c_str(),
+                                             APP2EXT_STATUS_SUCCESS);
+        } else {
+            m_handle->interface.post_upgrade(m_appId.c_str(),
+                                             APP2EXT_STATUS_FAILED);
+        }
     }
 }