Skip to content

Commit

Permalink
Check if contain module id (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard20181 authored Nov 12, 2023
1 parent 8a298bb commit 88d4eca
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 88d4eca

Please sign in to comment.