I have the code
if (WORDLIST[language]==null) throw new Exception("Invalid Language");
List<String> wordlist = WORDLIST[language];
the compiler says
Error: A value of type 'List?' can't be assigned to a variable of type 'List' because 'List?' is nullable and 'List' isn't.
However its both not possible in my code for language to be set to a value that is not valid and just to be safe there is the exception thrown if it gets called somewhere without checking the language exists. How can I get the compiler to recognize this is valid?
Full Code is here(though the exception was added afterwards to try and handle new compiler): https://github.com/mctrivia/bip39-multi/blob/mctrivia-patch-1/lib/src/bip39_multi_base.dart#L80