adds a test and implementation check for empty preferences

here's your patch @rwcarlsen