Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/class-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ function compileModule (env) {
const field = env.javaLangReflectField();
let j = javaApi;
[
jvmti,
jvmti !== null ? jvmti : ptr(0),
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jvmti !== null ? jvmti : ptr(0) only guards the null case. On Dalvik, android.getApi() doesn't define jvmti at all (so it will be undefined), which would still be passed into writePointer() and can throw Error: expected a pointer. Consider using a nullish check (treating both null and undefined as absent) and defaulting to a null pointer (NULL/ptr(0)).

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix with jvmti ?? ptr(0)?
But I'm not sure about jvmti being undefined instead of null on Dalvik devices 🤔

getDeclaredMethods, getDeclaredFields,
method.getName, method.getModifiers,
field.getName, field.getModifiers
Expand Down
Loading