Haptic-Apps / Slide

Slide is an open-source, ad-free Reddit browser for Android.
https://reddit.com/r/slideforreddit
GNU General Public License v3.0
1.78k stars 344 forks source link

NullPointerException on specific post #3471

Open the-blank-x opened 2 years ago

the-blank-x commented 2 years ago

Slide version: 6.7.1 Android version: 9

Opening https://redd.it/xa1csr crashes Slide, Logcat shows:

FATAL EXCEPTION: main
Process: me.ccrama.redditslide, PID: 22512
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference
    at me.ccrama.redditslide.ContentType.getContentType(ContentType.java:137)
    at me.ccrama.redditslide.ContentType.getContentType(ContentType.java:239)
    at me.ccrama.redditslide.SubmissionViews.PopulateSubmissionViewHolder.populateSubmissionViewHolder(PopulateSubmissionViewHolder.java:2643)
    at me.ccrama.redditslide.Adapters.CommentAdapter.onBindViewHolder(CommentAdapter.java:555)
    at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7254)
    at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7337)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6194)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6460)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6300)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6296)
    at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2330)
    at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1631)
    at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
    at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
    at me.ccrama.redditslide.Views.PreCachingLayoutManagerComments.onLayoutChildren(PreCachingLayoutManagerComments.java:20)
    at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
    at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4012)
    at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4578)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:625)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1213)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:899)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:919)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:20831)
    at android.view.ViewGroup.layout(ViewGroup.java:6203)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)