Meituan-Dianping / Meituan-Dianping/Robust

添加方法返回的字段为null

Open
#232 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.5k
Forks
806
PR merge metrics
No merged PRs in 30d

Description

添加方法返回的字段为null,
以及modify与add嵌套使用时,也会报错

异常类型:app运行时异常

手机型号:三星S7

手机系统版本:Android 7.0

Robust版本:0.4.75

Gradle版本:4.1

系统:win

堆栈/日志:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference
at com.meituan.robust.utils.EnhancedRobustUtils.invokeReflectMethod(EnhancedRobustUtils.java:34)
at smartref.zxz.com.robusttest.patch.MainActivity$1Patch.onClick(MainActivity$1Patch.java:24)
at smartref.zxz.com.robusttest.patch.MainActivity$1PatchControl.accessDispatch(PatchTemplate.java)
at com.meituan.robust.PatchProxy.accessDispatch(PatchProxy.java:69)
at smartref.zxz.com.robusttest.MainActivity$1.onClick(MainActivity.java)
at android.view.View.performClick(View.java:6213)
at android.widget.TextView.performClick(TextView.java:11074)
at android.view.View$PerformClick.run(View.java:23645)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6646)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace location in EnhancedRobustUtils.java, especially invokeReflectMethod, and inspect how the reported add operation and nested modify/add usage are handled. Reproduce the Android 7.0 case described for Robust 0.4.75, then verify that the returned field is not null and that the nested operations no longer raise the reported NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.