Description
envMap[activeEnvironmentId]! uses the null-assertion operator on a Map lookup, but Map.operator[] returns null when the key is absent. The guard only checks activeEnvironmentId != null, not whether that key exists in the map.
Steps to reproduce
- Open
lib/utils/envvar_utils.dart around line 292
- Throws 'Null check operator used on a null value' at runtime if getVariableStatus is called with a non-null activeEnvironmentId that has no entry in envMap.
Expected behavior
envMap[activeEnvironmentId] returns null when the key is missing; the ! operator converts that null into an exception. The sibling function getEnvironmentTriggerSuggestions (line 263) correctly guards with && envMap[activeEnvironmentId] != null before the same lookup. should be handled correctly.
Actual behavior
Throws 'Null check operator used on a null value' at runtime if getVariableStatus is called with a non-null activeEnvironmentId that has no entry in envMap.
Description
envMap[activeEnvironmentId]! uses the null-assertion operator on a Map lookup, but Map.operator[] returns null when the key is absent. The guard only checks activeEnvironmentId != null, not whether that key exists in the map.
Steps to reproduce
lib/utils/envvar_utils.dartaround line 292Expected behavior
envMap[activeEnvironmentId] returns null when the key is missing; the ! operator converts that null into an exception. The sibling function getEnvironmentTriggerSuggestions (line 263) correctly guards with && envMap[activeEnvironmentId] != null before the same lookup. should be handled correctly.
Actual behavior
Throws 'Null check operator used on a null value' at runtime if getVariableStatus is called with a non-null activeEnvironmentId that has no entry in envMap.