don't call replace() on null formattedNumber

Should be a simple fix to #1397's NPE