Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
Fixed in r1313.
ad...@google.com <ad...@google.com>
yb...@google.com <yb...@google.com> #3
[Empty comment from Monorail migration]
yb...@google.com <yb...@google.com>
ma...@gmail.com <ma...@gmail.com> #4
[Empty comment from Monorail migration]
yb...@google.com <yb...@google.com> #5
yb...@google.com <yb...@google.com> #6
i cherry picked it but it missed 3.4 :/. it will be in 3.4.1 (if happens). otherwise, it is already in 3.5
26...@gmail.com <26...@gmail.com> #7
Hi
sa...@gmail.com <sa...@gmail.com> #8
ดี
an...@gmail.com <an...@gmail.com> #10
akses kartu SD
Description
Version used: 3.4.0-alpha09
Devices/Android versions reproduced on:
Pixel 2 XL/Android 9
android.databinding.ViewDataBinding$LiveDataListener.onChanged cause NullpointerException
@Override
public void onChanged(@Nullable Object o) {
ViewDataBinding binder = mListener.getBinder();
binder.handleFieldChange(mListener.mLocalFieldId, mListener.getTarget(), 0);
}
Above code doesn't check nullity of binder which may be null. mListener is a ViewDataBinding.WeakListener, It's getBinder method goes like this:
protected ViewDataBinding getBinder() {
ViewDataBinding binder = get();
if (binder == null) {
unregister(); // The binder is dead
}
return binder;
}
When binder is GCed, null is returned and hence LiveDataListener.onChanged will fail with a NullpointerException.