Merge pull request #4023 from ByteHamster/fix-crash-click-timecode

Fix crash when clicking timecode
This commit is contained in:
H. Lehmann 2020-04-09 12:35:39 +02:00 committed by GitHub
commit 05c3b22da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.util.ObjectsCompat;
import androidx.fragment.app.Fragment;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.FitCenter;
@ -137,7 +138,8 @@ public class ItemFragment extends Fragment {
}
webvDescription = layout.findViewById(R.id.webvDescription);
webvDescription.setTimecodeSelectedListener(time -> {
if (controller != null && item.getMedia().getIdentifier().equals(controller.getMedia().getIdentifier())) {
if (controller != null && item.getMedia() != null && controller.getMedia() != null
&& ObjectsCompat.equals(item.getMedia().getIdentifier(), controller.getMedia().getIdentifier())) {
controller.seekTo(time);
} else {
Snackbar.make(getView(), R.string.play_this_to_seek_position, Snackbar.LENGTH_LONG).show();