File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,17 @@ class Polyseed {
23
23
/// Check if a seed is a valid Polyseed
24
24
static bool isValidSeed (String phrase, [PolyseedLang ? lang]) {
25
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;
26
+ try {
27
+ final polyseedLang = lang ?? PolyseedLang .getByPhrase (phrase);
28
+
29
+ return polyseedLang
30
+ .normalizeSeparator (phrase)
31
+ .split (polyseedLang.separator)
32
+ .length ==
33
+ numberOfWords;
34
+ } on UnknownLangException catch (_) {
35
+ return false ;
36
+ }
33
37
}
34
38
35
39
/// Create a random [Polyseed]
You can’t perform that action at this time.
0 commit comments