fixed crash when preference settings has null values