Skip to content

Commit 0ecc0a0

Browse files
committed
Handle situation where PAT_ might be the only string, which would result in empty string for map key
1 parent ae60e68 commit 0ecc0a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const port = 3000
77
const env_list = process.env
88
for(var i in env_list) {
99
if(i.startsWith('PAT_')){
10-
org_pat_map[i.replace('PAT_', '')] = env_list[i].trim()
10+
const pat_label = i.replace('PAT_', '')
11+
if (pat_label) {
12+
org_pat_map[pat_label] = env_list[i].trim()
13+
}
1114
}
1215
}
1316

0 commit comments

Comments
 (0)