Skip to content

Commit

Permalink
Check if contain module id
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard20181 committed Nov 12, 2023
1 parent 5526fa2 commit 717ed58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userspace/ksud/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ fn _list_modules(path: &str) -> Vec<HashMap<String, String>> {
module_prop_map.insert(k, v);
});

if module_prop_map["id"].is_empty() {
if !module_prop_map.contains_key("id") || module_prop_map["id"].is_empty() {
if let Some(id) = entry.file_name().to_str() {
info!("Use dir name as module id: {}", id);
module_prop_map.insert("id".to_owned(), id.to_owned());
Expand Down

0 comments on commit 717ed58

Please sign in to comment.