@@ -291,6 +291,7 @@ void ContentAppPlatform::SetupAppPlatform()
291291
292292ContentApp * ContentAppPlatform::GetContentAppInternal (const CatalogVendorApp & vendorApp)
293293{
294+ VerifyOrReturnValue (mContentAppFactory != nullptr , nullptr );
294295 if (vendorApp.catalogVendorId != mContentAppFactory ->GetPlatformCatalogVendorId ())
295296 {
296297 return nullptr ;
@@ -325,6 +326,7 @@ ContentApp * ContentAppPlatform::LoadContentAppInternal(const CatalogVendorApp &
325326ContentApp * ContentAppPlatform::LoadContentAppByClient (uint16_t vendorId, uint16_t productId)
326327{
327328 ChipLogProgress (DeviceLayer, " LoadContentAppByVendorId() - vendorId %d, productId %d" , vendorId, productId);
329+ VerifyOrReturnValue (mContentAppFactory != nullptr , nullptr );
328330
329331 CatalogVendorApp vendorApp;
330332 CHIP_ERROR err = mContentAppFactory ->LookupCatalogVendorApp (vendorId, productId, &vendorApp);
@@ -339,6 +341,7 @@ ContentApp * ContentAppPlatform::LoadContentAppByClient(uint16_t vendorId, uint1
339341
340342ContentApp * ContentAppPlatform::LoadContentApp (const CatalogVendorApp & vendorApp)
341343{
344+ VerifyOrReturnValue (mContentAppFactory != nullptr , nullptr );
342345 if (vendorApp.catalogVendorId == mContentAppFactory ->GetPlatformCatalogVendorId ())
343346 {
344347 return LoadContentAppInternal (vendorApp);
@@ -356,6 +359,7 @@ ContentApp * ContentAppPlatform::LoadContentApp(const CatalogVendorApp & vendorA
356359
357360ContentApp * ContentAppPlatform::GetContentApp (const CatalogVendorApp & vendorApp)
358361{
362+ VerifyOrReturnValue (mContentAppFactory != nullptr , nullptr );
359363 if (vendorApp.catalogVendorId == mContentAppFactory ->GetPlatformCatalogVendorId ())
360364 {
361365 return GetContentAppInternal (vendorApp);
@@ -671,6 +675,7 @@ CHIP_ERROR ContentAppPlatform::ManageClientAccess(Messaging::ExchangeManager & e
671675{
672676 VerifyOrReturnError (successCb != nullptr , CHIP_ERROR_INVALID_ARGUMENT);
673677 VerifyOrReturnError (failureCb != nullptr , CHIP_ERROR_INVALID_ARGUMENT);
678+ VerifyOrReturnError (mContentAppFactory != nullptr , CHIP_ERROR_INCORRECT_STATE);
674679
675680 Access::Privilege vendorPrivilege = mContentAppFactory ->GetVendorPrivilege (targetVendorId);
676681
0 commit comments