1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-12-02 14:09:38 +00:00

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

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()?;
}
}