We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f19b661 commit 1a8280aCopy full SHA for 1a8280a
lib/src/polyseed.dart
@@ -23,13 +23,17 @@ class Polyseed {
23
/// Check if a seed is a valid Polyseed
24
static bool isValidSeed(String phrase, [PolyseedLang? lang]) {
25
if (lang != null && !PolyseedLang.isValidPhrase(phrase)) return false;
26
- final polyseedLang = lang ?? PolyseedLang.getByPhrase(phrase);
27
-
28
- return polyseedLang
29
- .normalizeSeparator(phrase)
30
- .split(polyseedLang.separator)
31
- .length ==
32
- numberOfWords;
+ try {
+ final polyseedLang = lang ?? PolyseedLang.getByPhrase(phrase);
+
+ return polyseedLang
+ .normalizeSeparator(phrase)
+ .split(polyseedLang.separator)
+ .length ==
33
+ numberOfWords;
34
+ } on UnknownLangException catch (_) {
35
+ return false;
36
+ }
37
}
38
39
/// Create a random [Polyseed]
0 commit comments