minor fix

This commit is contained in:
Thibault Deckers 2022-02-28 21:47:02 +09:00
parent 437572550a
commit 085f4b2eca
2 changed files with 2 additions and 2 deletions

View file

@ -302,7 +302,7 @@ class _ContentState extends State<_Content> with SingleTickerProviderStateMixin
if (regionCollection != null) {
final regionEntries = regionCollection!.sortedEntries;
final selectedIndex = _selectedIndexNotifier.value;
selectedEntry = selectedIndex != null && selectedIndex < regionEntries.length ? regionEntries[selectedIndex] : null;
selectedEntry = selectedIndex != null && 0 <= selectedIndex && selectedIndex < regionEntries.length ? regionEntries[selectedIndex] : null;
}
_regionCollectionNotifier.value = openingCollection.copyWith(

View file

@ -56,7 +56,7 @@ class _ViewerThumbnailPreviewState extends State<ViewerThumbnailPreview> {
return ThumbnailScroller(
availableWidth: widget.availableWidth,
entryCount: entryCount,
entryBuilder: (index) => index < entryCount ? entries[index] : null,
entryBuilder: (index) => 0 <= index && index < entryCount ? entries[index] : null,
indexNotifier: _entryIndexNotifier,
onTap: (index) => ViewEntryNotification(index: index).dispatch(context),
);