fix bug when user prefs is null

cbugg: close bug-399