mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
Fix NPE in viewer pane
This commit is contained in:
parent
7c83b81810
commit
702fac4b38
1 changed files with 10 additions and 5 deletions
|
@ -146,11 +146,16 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
|
|||
final timeStr = DateFormat(DateFormat.HOUR_MINUTE,
|
||||
Localizations.localeOf(context).languageCode)
|
||||
.format(_dateTime);
|
||||
final collectionAdapter = CollectionAdapter.of(KiwiContainer().resolve(),
|
||||
widget.account, widget.fromCollection!.collection);
|
||||
final isShowDelete = widget.fromCollection != null &&
|
||||
collectionAdapter.isPermitted(CollectionCapability.deleteItem) &&
|
||||
collectionAdapter.isItemDeletable(widget.fromCollection!.item);
|
||||
final bool isShowDelete;
|
||||
if (widget.fromCollection != null) {
|
||||
final collectionAdapter = CollectionAdapter.of(KiwiContainer().resolve(),
|
||||
widget.account, widget.fromCollection!.collection);
|
||||
isShowDelete =
|
||||
collectionAdapter.isPermitted(CollectionCapability.deleteItem) &&
|
||||
collectionAdapter.isItemDeletable(widget.fromCollection!.item);
|
||||
} else {
|
||||
isShowDelete = false;
|
||||
}
|
||||
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
|
|
Loading…
Reference in a new issue