We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23ef650 commit 3ab77e0Copy full SHA for 3ab77e0
src/pages/contributors.rs
@@ -99,7 +99,13 @@ pub async fn fetch_contributors() -> Vec<Contributor> {
99
.as_array()
100
.unwrap_or(&Vec::new())
101
.iter()
102
- .flat_map(|repo| repo["collaborators"]["nodes"].as_array().unwrap())
+ .flat_map(|repo| {
103
+ if !repo["collaborators"].is_null() {
104
+ repo["collaborators"]["nodes"].as_array().unwrap()
105
+ } else {
106
+ &Vec::new()
107
+ }
108
+ })
109
.filter_map(|c| leptos::serde_json::from_value::<Contributor>(c.clone()).ok())
110
.fold(HashMap::new(), |prev, c| {
111
let mut prev = prev;
0 commit comments