mirror of
https://github.com/aljazceru/pkdns.git
synced 2025-12-17 22:14:27 +01:00
fix: prevent panic if query has no question
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1008,7 +1008,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkdns"
|
name = "pkdns"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any-dns",
|
"any-dns",
|
||||||
"clap",
|
"clap",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pkdns"
|
name = "pkdns"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@@ -46,7 +46,11 @@ impl PknamesResolver {
|
|||||||
return pkarr_result; // It was a pkarr hostname
|
return pkarr_result; // It was a pkarr hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
let question = original_query.questions.first().unwrap();
|
let question = original_query.questions.first();
|
||||||
|
if let None = question {
|
||||||
|
|
||||||
|
}
|
||||||
|
let question = original_query.questions.first().ok_or("Query does not include a question.")?;
|
||||||
let domain = question.qname.to_string();
|
let domain = question.qname.to_string();
|
||||||
let pkarr_domain = self.predict_pknames_domain(&domain)?;
|
let pkarr_domain = self.predict_pknames_domain(&domain)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user