Skip to content

Commit 1641196

Browse files
andy31415pull[bot]
authored andcommitted
Fix cast for error: CHIP_ERROR is not an integer without explicit cast (#24385)
1 parent d0114a9 commit 1641196

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/controller/java/AndroidCallbacks.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ void GetConnectedDeviceCallback::OnDeviceConnectionFailureFn(void * context, con
113113
JniClass controllerExceptionJniCls(controllerExceptionCls);
114114

115115
jmethodID exceptionConstructor = env->GetMethodID(controllerExceptionCls, "<init>", "(ILjava/lang/String;)V");
116-
jobject exception = env->NewObject(controllerExceptionCls, exceptionConstructor, error, env->NewStringUTF(ErrorStr(error)));
116+
jobject exception =
117+
env->NewObject(controllerExceptionCls, exceptionConstructor, error.AsInteger(), env->NewStringUTF(ErrorStr(error)));
117118

118119
DeviceLayer::StackUnlock unlock;
119120
env->CallVoidMethod(javaCallback, failureMethod, peerId.GetNodeId(), exception);

0 commit comments

Comments
 (0)