Skip to content

Commit 30d5d02

Browse files
committed
fix(config): treat empty env variables as null
Updates the `_getEnv` helper to return `null` if an environment variable is found but is an empty string. This makes the configuration handling more robust by preventing services from being initialized with invalid empty credentials, which would cause runtime failures.
1 parent 85150c4 commit 30d5d02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/config/environment_config.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ abstract final class EnvironmentConfig {
6363
static String? _getEnv(String key) {
6464
final value = _env[key];
6565
if (value == null || value.isEmpty) {
66-
_log.warning('$key not found in environment variables.');
66+
_log.warning('$key not found or is empty in environment variables.');
67+
return null;
6768
}
6869

6970
return value;

0 commit comments

Comments
 (0)