bug fix：修复在数据库为空时的异常

Signed-off-by: Haozi Leung <haozileung.cn@gmail.com>