From 5051ac25c65c4d557dc768b0c19329a40b1c236f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Fri, 18 Mar 2022 22:22:32 +0100 Subject: [PATCH] decode valueless entires as NaN since NaN == NULL in SQLite, apparently --- src/database/entry.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/database/entry.rs b/src/database/entry.rs index 26d9360..296eaa0 100644 --- a/src/database/entry.rs +++ b/src/database/entry.rs @@ -50,9 +50,11 @@ impl TryFrom<&models::Entry> for Entry { value: EntryValue::Number(value_num), }) } else { - Err(anyhow!( - "Inconsistent database: Both values of entry are NULL!" - )) + Ok(Entry { + entity: Address::decode(&e.entity)?, + attribute: e.attribute.clone(), + value: EntryValue::Number(f64::NAN), + }) } } }