Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

预览音频返回崩溃!!! #2624

Closed
wangzongguang opened this issue Mar 15, 2023 · 1 comment
Closed

预览音频返回崩溃!!! #2624

wangzongguang opened this issue Mar 15, 2023 · 1 comment

Comments

@wangzongguang
Copy link

Current use version?

当前使用的版本是多少?

v3.10.8

Will this problem occur in demo?

Demo能否复现这问题?

Describe the problem or provide an error log?

描述问题或提供错误log?

 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.media.MediaPlayer.isPlaying()' on a null object reference
        at com.luck.picture.lib.adapter.holder.PreviewAudioHolder.isPlaying(PreviewAudioHolder.java:233)
        at com.luck.picture.lib.adapter.PicturePreviewAdapter.isPlaying(PicturePreviewAdapter.java:155)
        at com.luck.picture.lib.PictureSelectorPreviewFragment.isPlaying(PictureSelectorPreviewFragment.java:1717)
        at com.luck.picture.lib.PictureSelectorPreviewFragment.onPause(PictureSelectorPreviewFragment.java:1701)
@actor20170211030627
Copy link

actor20170211030627 commented Apr 3, 2023

我也遇到同样问题, v3.10.8, Demo复现:
1.选择音频类型 & 能预览.
2.点击选择1个音频, 点开预览, 在"预览界面"点击下方的"已完成", 崩溃.
crash1

另外, 在"PicturePreviewAdapter"中发现判断不科学:

public LocalMedia getItem(int position) {
    if (position > mData.size()) {    //">"  应该改成  ">="吧?
        return null;
    }
    return mData.get(position);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants