Avoid NPE when preference type is undefined