Sanity-check value to prevent overflow.

This commit is contained in:
Nolan Darilek 2020-07-06 12:14:50 -05:00
parent eb936a4ae0
commit 1d7c668a4a
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ impl Backend for WinRT {
if state == MediaPlaybackState::Paused {
let index = self.playback_list.current_item_index()?;
let total = self.playback_list.items()?.size()?;
if index == total - 1 {
if total != 0 && index == total - 1 {
self.playback_list.items()?.clear()?;
}
}