Fix NullPointerException when sharing a playlist which is loading

Prevent a NullPointerException by adding a null check for currentInfo when sharing a playlist.
This commit is contained in:
TiA4f8R 2022-01-15 21:19:04 +01:00
parent 9ff1baefde
commit 6672169707
No known key found for this signature in database
GPG key ID: E6D3E7F5949450DD

View file

@ -268,7 +268,10 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
ShareUtils.openUrlInBrowser(requireContext(), url); ShareUtils.openUrlInBrowser(requireContext(), url);
break; break;
case R.id.menu_item_share: case R.id.menu_item_share:
ShareUtils.shareText(requireContext(), name, url, currentInfo.getThumbnailUrl()); if (currentInfo != null) {
ShareUtils.shareText(requireContext(), name, url,
currentInfo.getThumbnailUrl());
}
break; break;
case R.id.menu_item_bookmark: case R.id.menu_item_bookmark:
onBookmarkClicked(); onBookmarkClicked();