Fix crash when failed to read recovery file 58/275558/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 26 May 2022 08:02:06 +0000 (17:02 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 26 May 2022 08:02:06 +0000 (17:02 +0900)
Change-Id: I29786ba284d1d413afc975e03d234f620d333b01
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/wgt/utils/wgt_app_query_interface.cc

index 3c6772f..2336a55 100644 (file)
@@ -43,6 +43,10 @@ const char kTizenManifestLocation[] = "tizen-manifest.xml";
 std::string ReadPkgidFromRecovery(const std::string& recovery_path) {
   std::unique_ptr<ci::recovery::RecoveryFile> recovery_file =
       ci::recovery::RecoveryFile::OpenRecoveryFile(recovery_path);
+  if (!recovery_file) {
+    LOG(ERROR) << "Failed to read pkgid from recovery file";
+    return ".";
+  }
   recovery_file->Detach();
   return recovery_file->pkgid();
 }