mirror of https://github.com/ndarilek/tts-rs.git
Sanity-check value to prevent overflow.
This commit is contained in:
parent
eb936a4ae0
commit
1d7c668a4a
|
@ -60,7 +60,7 @@ impl Backend for WinRT {
|
||||||
if state == MediaPlaybackState::Paused {
|
if state == MediaPlaybackState::Paused {
|
||||||
let index = self.playback_list.current_item_index()?;
|
let index = self.playback_list.current_item_index()?;
|
||||||
let total = self.playback_list.items()?.size()?;
|
let total = self.playback_list.items()?.size()?;
|
||||||
if index == total - 1 {
|
if total != 0 && index == total - 1 {
|
||||||
self.playback_list.items()?.clear()?;
|
self.playback_list.items()?.clear()?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue