Applying Joanne's subsequent patch from LANG-875 making appendIfMissing use the same logic for null as endsWith (by reusing endsWith).