fix a test

prefs may be null