Skip to content

Commit

Permalink
Fix potential crashes with more nullable fields
Browse files Browse the repository at this point in the history
Fields like Comment or Description can be null.

This fixes #3
  • Loading branch information
chamilad committed Oct 15, 2024
1 parent c8f43bb commit 2edbafc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pihole/gravity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ struct Domain {
pub domain: String,
pub enabled: i32,
pub date_added: i64,
pub comment: String,
pub comment: Option<String>, // a field that can be nullable
}

impl Restorable for DomainList {
Expand Down Expand Up @@ -214,7 +214,7 @@ struct Ad {
pub address: String,
pub enabled: i32,
pub date_added: i64,
pub comment: String,
pub comment: Option<String>,
}

impl Restorable for AdList {
Expand Down Expand Up @@ -350,7 +350,7 @@ struct Client {
pub id: i32,
pub ip: String,
pub date_added: i64,
pub comment: String,
pub comment: Option<String>,
}

impl Restorable for ClientList {
Expand Down

0 comments on commit 2edbafc

Please sign in to comment.