Skip to content

Commit 42d435f

Browse files
committed
chore: check that the value is a string _just in case_.
Environment variables are always strings, but we will add this check in case we receive something that is not process.env.
1 parent 34a7296 commit 42d435f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function parseEnvConfig(env: Record<string, unknown>): Partial<UserConfig> {
192192
}
193193
if (path.length === 0) {
194194
// MongoDB URLs must not be preprocessed
195-
if (value.startsWith("mongodb://") || value.startsWith("mongodb+srv://")) {
195+
if (typeof value === "string" && (value.startsWith("mongodb://") || value.startsWith("mongodb+srv://"))) {
196196
obj[currentField] = value;
197197
return;
198198
}

0 commit comments

Comments
 (0)