diff --git a/lib/api.dart b/lib/api.dart index df44196b..b58b620f 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -488,7 +488,16 @@ class InvenTreeAPI { List perms = List.from(roles[role] as List); return perms.contains(permission); } catch (error, stackTrace) { - sentryReportError(error, stackTrace); + if (error is CastError) { + // Ignore CastError + } else if (error is TypeError) { + // Ignore TypeError + } else { + // Unknown error - report it! + sentryReportError(error, stackTrace); + } + + // Unable to determine permission - assume true? return true; } }