fix js errors caused by an empty db
Merge pull request #1 from bdwain/master

fix javascript errors caused by an empty database