Merge "Fix NPE caused by null replacedPkgSetting" into main