From 8de7896d4efbbb39d71789630c209b04a5d6fea7 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 11 Jan 2021 17:29:40 +0900 Subject: [PATCH] viewer: fixed page position overlay for multipage entries with no page info --- lib/widgets/fullscreen/overlay/bottom.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/widgets/fullscreen/overlay/bottom.dart b/lib/widgets/fullscreen/overlay/bottom.dart index 762f995e8..9e495c756 100644 --- a/lib/widgets/fullscreen/overlay/bottom.dart +++ b/lib/widgets/fullscreen/overlay/bottom.dart @@ -325,11 +325,14 @@ class _PositionTitleRow extends StatelessWidget { future: multiPageController.info, builder: (context, snapshot) { final multiPageInfo = snapshot.data; - final pageCount = multiPageInfo?.pageCount ?? '?'; + final pageCount = multiPageInfo?.pageCount; + // page count may be 0 when we know an entry to have multiple pages + // but fail to get information about these pages + final missingInfo = pageCount == 0; return ValueListenableBuilder( valueListenable: multiPageController.pageNotifier, builder: (context, page, child) { - return toText(pagePosition: '${page + 1}/$pageCount'); + return toText(pagePosition: missingInfo ? null : '${page + 1}/${pageCount ?? '?'}'); }, ); },