From 5d4c8ef178c7fb4abb007319da20a93e77388e79 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sun, 31 May 2020 02:12:14 +0200 Subject: [PATCH] Photo: Ignore photo_access_denied exception Fixes APP-2Y --- lib/editors/common.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/editors/common.dart b/lib/editors/common.dart index c3c8ae1c..cfda58f6 100644 --- a/lib/editors/common.dart +++ b/lib/editors/common.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:gitjournal/core/note.dart'; import 'package:gitjournal/core/notes_folder_fs.dart'; @@ -188,6 +189,10 @@ Widget _buildAddBottomSheet( await editorState.addImage(image); } } catch (e) { + if (e is PlatformException && e.code == "photo_access_denied") { + Navigator.of(context).pop(); + return; + } reportError(e, StackTrace.current); } Navigator.of(context).pop();