From 6672169707f4c775e49ceefc9c5a4eb9ced3f067 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sat, 15 Jan 2022 21:19:04 +0100 Subject: [PATCH] Fix NullPointerException when sharing a playlist which is loading Prevent a NullPointerException by adding a null check for currentInfo when sharing a playlist. --- .../newpipe/fragments/list/playlist/PlaylistFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java index a61cec11d..85c47ec74 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java @@ -268,7 +268,10 @@ public class PlaylistFragment extends BaseListInfoFragment { ShareUtils.openUrlInBrowser(requireContext(), url); break; case R.id.menu_item_share: - ShareUtils.shareText(requireContext(), name, url, currentInfo.getThumbnailUrl()); + if (currentInfo != null) { + ShareUtils.shareText(requireContext(), name, url, + currentInfo.getThumbnailUrl()); + } break; case R.id.menu_item_bookmark: onBookmarkClicked();