Fixed "Cannot read property 'substr' of null"

Error occurs when entering multiple dots