Merge "Fix potential NPE when preference is null"