Forbid empty titles in application layer

This commit is contained in:
Magnus Hoff 2017-10-30 13:20:40 +01:00
parent dd97b8055c
commit 3dd4927281

View file

@ -204,6 +204,10 @@ impl State {
let connection_pool = self.connection_pool.clone();
self.cpu_pool.spawn_fn(move || {
if title.is_empty() {
Err("title cannot be empty")?;
}
let conn = connection_pool.get()?;
conn.transaction(|| {
@ -263,6 +267,10 @@ impl State {
let connection_pool = self.connection_pool.clone();
self.cpu_pool.spawn_fn(move || {
if title.is_empty() {
Err("title cannot be empty")?;
}
let conn = connection_pool.get()?;
conn.transaction(|| {