From 14cf1b3edf8d47e951616f0e07cb904fbfe0024a Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Thu, 19 Mar 2020 18:40:40 +0900 Subject: [PATCH] Viewer: prevent tag navigation --- lib/model/collection_lens.dart | 6 +++++- lib/widgets/fullscreen/info/xmp_section.dart | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/model/collection_lens.dart b/lib/model/collection_lens.dart index 4b49146ac..f6c2e12fa 100644 --- a/lib/model/collection_lens.dart +++ b/lib/model/collection_lens.dart @@ -39,9 +39,13 @@ class CollectionLens with ChangeNotifier { } factory CollectionLens.from(CollectionLens lens, CollectionFilter filter) { + if (lens == null) return null; return CollectionLens( source: lens.source, - filters: [...lens.filters, filter], + filters: [ + ...lens.filters, + if (filter != null) filter, + ], groupFactor: lens.groupFactor, sortFactor: lens.sortFactor, ); diff --git a/lib/widgets/fullscreen/info/xmp_section.dart b/lib/widgets/fullscreen/info/xmp_section.dart index 98e2469c7..e5cbfe80d 100644 --- a/lib/widgets/fullscreen/info/xmp_section.dart +++ b/lib/widgets/fullscreen/info/xmp_section.dart @@ -24,7 +24,7 @@ class XmpTagSectionSliver extends AnimatedWidget { tags.isEmpty ? [] : [ - const SectionRow('XMP Tags'), + const SectionRow('Tags'), Padding( padding: const EdgeInsets.symmetric(horizontal: TagButton.buttonBorderWidth / 2), child: Wrap( @@ -43,6 +43,7 @@ class XmpTagSectionSliver extends AnimatedWidget { } void _goToTag(BuildContext context, String tag) { + if (collection == null) return; Navigator.push( context, MaterialPageRoute(