Appboy / appboy-android-sdk

Public repo for the Braze Android SDK
https://www.braze.com
Other
152 stars 102 forks source link

[Bug]: NullPointerException in `BrazeCardView.setCardViewedIndicator`: Parameter specified as non-null is null #227

Closed mattsilber closed 2 years ago

mattsilber commented 2 years ago

Braze Android SDK Version

21.0.0

Steps To Reproduce

Include an AppboyFeedFragment in an Activity layout:

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/braze_feed_fragment"
        android:name="com.appboy.ui.AppboyFeedFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

Expected Behavior

It shouldn't crash.

Actual Incorrect Behavior

It crashes.

Verbose Logs

java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter imageSwitcher
        at com.appboy.ui.widget.BaseCardView.setCardViewedIndicator(Unknown Source:2)
        at com.appboy.ui.feed.view.BaseFeedCardView.setCard(BaseFeedCardView.java:66)
        at com.appboy.ui.adapters.AppboyListAdapter.getView(AppboyListAdapter.java:112)
        at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:224)
        at android.widget.AbsListView.obtainView(AbsListView.java:2387)
        at android.widget.ListView.makeAndAddView(ListView.java:2067)
        at android.widget.ListView.fillDown(ListView.java:793)
        at android.widget.ListView.fillFromTop(ListView.java:855)
        at android.widget.ListView.layoutChildren(ListView.java:1810)
        at android.widget.AbsListView.onLayout(AbsListView.java:2184)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:689)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at com.android.internal.policy.DecorView.onLayout(DecorView.java:784)
        at android.view.View.layout(View.java:22844)
        at android.view.ViewGroup.layout(ViewGroup.java:6389)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3470)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2938)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:731)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)

Additional Information

No response

chshapiro commented 2 years ago

Hi @mattsilber,

Thanks for reporting this issue. We will be releasing a fix next week. This issue will be updated when the fix is live.

bryanlogan commented 2 years ago

Hi @mattsilber,

We fixed this issue in 22.0.0. Please let us know if this fixes your issue.