target comments from @flub

This commit is contained in:
B. Petersen
2020-02-14 11:56:59 +01:00
parent 84f8627890
commit 1f9520dc78
2 changed files with 6 additions and 8 deletions

View File

@@ -958,10 +958,8 @@ impl rusqlite::types::FromSql for ChatVisibility {
2 => Ok(ChatVisibility::Pinned),
1 => Ok(ChatVisibility::Archived),
0 => Ok(ChatVisibility::Normal),
n => {
// unknown archived state, falling back to normal state (was this db opened with a newer deltachat version?)
Err(rusqlite::types::FromSqlError::OutOfRange(n))
}
// fallback to to Normal for unknown values, may happen eg. on imports created by a newer version.
_ => Ok(ChatVisibility::Normal),
}
})
}