Skip to content

Commit 99030b8

Browse files
committed
fix
1 parent 91f41b1 commit 99030b8

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

server/src/domain_storage.rs

+17-11
Original file line numberDiff line numberDiff line change
@@ -536,19 +536,25 @@ impl DomainStorage {
536536
}
537537
}
538538
pub fn check_if_empty_index(&self, host: &str, path: &str) -> bool {
539-
self.meta
540-
.get(host)
541-
.map(|v| match v.value() {
542-
DomainMeta::OneWeb { .. } => path.is_empty(),
543-
DomainMeta::MultipleWeb(map) => {
544-
if path.len() > 1 {
545-
map.contains_key(&path[1..])
546-
} else {
547-
map.contains_key(path)
539+
match self.meta
540+
.get(host) {
541+
Some(v) => {
542+
match v.value() {
543+
DomainMeta::OneWeb { .. } => path.is_empty(),
544+
DomainMeta::MultipleWeb(map) => {
545+
if path.len() > 1 {
546+
map.contains_key(&path[1..])
547+
} else {
548+
map.contains_key(path)
549+
}
548550
}
549551
}
550-
})
551-
.unwrap_or(false)
552+
},
553+
None => {
554+
debug!("{host} {path} does not exists in meta");
555+
false
556+
}
557+
}
552558
}
553559

554560
pub fn save_file(

0 commit comments

Comments
 (0)