From 3b78c549e50583ef96e63302bb446c1a236d8061 Mon Sep 17 00:00:00 2001 From: Guillaume BOEHM Date: Thu, 1 Sep 2022 17:34:12 +0200 Subject: [PATCH] tr() call exception added - tr() calls to a key with more nested keys return a clearer exception --- lib/src/translations.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/translations.dart b/lib/src/translations.dart index 6dd89b59..c3672db3 100644 --- a/lib/src/translations.dart +++ b/lib/src/translations.dart @@ -35,6 +35,7 @@ class Translations { /// If we found the value, cache it. If the value is null then /// we're not going to cache it, and returning null instead. if (value != null) { + if(value.runtimeType != String) throw Exception('The requested key has more nested keys.'); cacheNestedKey(key, value); }