Skip to content

Commit

Permalink
check for empty value
Browse files Browse the repository at this point in the history
  • Loading branch information
aracho1 committed Jun 5, 2024
1 parent df509d3 commit f05d272
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ async fn main() -> Result<(), Error> {
let ignored_users: Vec<&str> = ignored_users.split(",").collect();
let announced_users: Option<Vec<i32>> = env::var("GITHUB_ANNOUNCED_USERS")
.ok()
.map(|s| s.split(',').map(|id| id.parse().unwrap()).collect());
.and_then(|s| {
if s.is_empty() {
None
} else {
Some(s.split(',').map(|id| id.parse().unwrap()).collect())
}
});
let ignored_labels: String = env::var("GITHUB_IGNORED_LABELS").unwrap_or("".to_string());
let ignored_labels: Vec<&str> = ignored_labels.split(",").collect();
let show_pr_age: bool = env::var("SHOW_PR_AGE")
Expand Down

0 comments on commit f05d272

Please sign in to comment.