fix: handle null configurations key in reconfigure dart config#434
fix: handle null configurations key in reconfigure dart config#434Harshit-0413 wants to merge 1 commit into
Conversation
|
|
There was a problem hiding this comment.
Code Review
This pull request updates the reconfigure.dart file to handle cases where the configurations map might be null. It introduces a null-safe cast and a check that returns an empty list if the configurations are missing, preventing potential runtime errors. I have no feedback to provide.
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 15 days until this gets closed automatically |
Fixes #353
Problem
When running
flutterfire configuretwice and choosing to reuse theexisting
firebase.json, the command crashes with:Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
This happens in
_writeDartConfigurationFileinreconfigure.dartwhere
map[kConfigurations]is cast directly without a null check.If the existing
firebase.jsonwas written by an older CLI versionthat didn't include the
configurationskey, the cast throws.Fix
Cast
map[kConfigurations]as nullableMap<String, dynamic>?andreturn early if null, skipping that entry gracefully.