Fix the crash in usd-loader automated test 83/318583/1
authorRichard Huang <r.huang@samsung.com>
Wed, 2 Oct 2024 11:46:18 +0000 (12:46 +0100)
committerRichard Huang <r.huang@samsung.com>
Wed, 2 Oct 2024 11:46:18 +0000 (12:46 +0100)
Change-Id: Iedaccf0416035553caeff9282de8db37cb692997

dali-usd-loader/internal/usd-loader-impl.cpp

index 1645ffc..fbbdc39 100644 (file)
@@ -472,6 +472,11 @@ bool UsdLoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::Loa
 {
   // Open the stage of the USD scene from the specified URL
   mImpl->mUsdStage = UsdStage::Open(url);
+  if(!mImpl->mUsdStage)
+  {
+    DALI_LOG_ERROR("Failed to open %s\n", url.c_str());
+    return false;
+  }
 
   mImpl->mMeshCount       = 0;
   mImpl->mNodeIndex       = INVALID_INDEX;