Take care of empty hooks in the db

Signed-off-by: emanuele <emanuele45@gmail.com>