diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index d6fadc7926c19b..b1c8b02ff2e597 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -216,11 +216,16 @@ AndroidDeviceControllerWrapper * AndroidDeviceControllerWrapper::AllocateNew( } initParams.opCertStore = &wrapper->mOpCertStore; #ifdef JAVA_MATTER_CONTROLLER_TEST - opCredsIssuer->Initialize(wrapper->mExampleStorage); + err = opCredsIssuer->Initialize(wrapper->mExampleStorage); #else // TODO: Init IPK Epoch Key in opcreds issuer, so that commissionees get the right IPK - opCredsIssuer->Initialize(*wrapper.get(), &wrapper->mAutoCommissioner, wrapper.get()->mJavaObjectRef); + err = opCredsIssuer->Initialize(*wrapper.get(), &wrapper->mAutoCommissioner, wrapper.get()->mJavaObjectRef); #endif + if (err != CHIP_NO_ERROR) + { + *errInfoOnFailure = err; + return nullptr; + } Platform::ScopedMemoryBuffer noc; if (!noc.Alloc(kMaxCHIPDERCertLength))