Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed Oct 5, 2023
1 parent 8fbaa36 commit d21756f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controller/java/AndroidCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ void ReportCallback::ReportError(jobject attributePath, jobject eventPath, const
VerifyOrReturn(
err == CHIP_NO_ERROR,
ChipLogError(Controller, "Unable to create AndroidControllerException on ReportCallback::ReportError: %s", ErrorStr(err)));
JniObject(env, static_cast<jobject>(exception));
JniObject exceptionJniCls(env, static_cast<jobject>(exception));
jmethodID onErrorMethod;
err = JniReferences::GetInstance().FindMethod(
env, mReportCallbackRef, "onError",
Expand Down
3 changes: 2 additions & 1 deletion src/controller/java/AndroidControllerExceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ CHIP_ERROR AndroidControllerExceptions::CreateAndroidControllerException(JNIEnv
CHIP_ERROR err = JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipDeviceControllerException",
controllerExceptionCls);
VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_JNI_ERROR_TYPE_NOT_FOUND);
JniClass controllerExceptionJniCls(controllerExceptionCls);

JniObject controllerExceptionJniCls(env, static_cast<jobject>(controllerExceptionCls));

jmethodID exceptionConstructor = env->GetMethodID(controllerExceptionCls, "<init>", "(JLjava/lang/String;)V");
jobject localRef =
Expand Down

0 comments on commit d21756f

Please sign in to comment.