Make sure that video player controller exists before attempting to dispose it
This commit is contained in:
parent
a7582df1ed
commit
d99ac864af
1 changed files with 3 additions and 1 deletions
|
@ -76,7 +76,9 @@ class _VideoWidgetState extends State<VideoWidget> {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
_videoPlayerController.dispose();
|
||||
if (_videoPlayerController != null) {
|
||||
_videoPlayerController.dispose();
|
||||
}
|
||||
if (_chewieController != null) {
|
||||
_chewieController.dispose();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue