mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +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,
|
final timeStr = DateFormat(DateFormat.HOUR_MINUTE,
|
||||||
Localizations.localeOf(context).languageCode)
|
Localizations.localeOf(context).languageCode)
|
||||||
.format(_dateTime);
|
.format(_dateTime);
|
||||||
|
final bool isShowDelete;
|
||||||
|
if (widget.fromCollection != null) {
|
||||||
final collectionAdapter = CollectionAdapter.of(KiwiContainer().resolve(),
|
final collectionAdapter = CollectionAdapter.of(KiwiContainer().resolve(),
|
||||||
widget.account, widget.fromCollection!.collection);
|
widget.account, widget.fromCollection!.collection);
|
||||||
final isShowDelete = widget.fromCollection != null &&
|
isShowDelete =
|
||||||
collectionAdapter.isPermitted(CollectionCapability.deleteItem) &&
|
collectionAdapter.isPermitted(CollectionCapability.deleteItem) &&
|
||||||
collectionAdapter.isItemDeletable(widget.fromCollection!.item);
|
collectionAdapter.isItemDeletable(widget.fromCollection!.item);
|
||||||
|
} else {
|
||||||
|
isShowDelete = false;
|
||||||
|
}
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
|
|
Loading…
Reference in a new issue