fix errors if no preferences exist

Signed-off-by: nuss <st9fan@gmail.com>