Guard against unnecessary NSScanner log messages

When `NSScanner#scannerWithString` is called with a nil argument it emits an unnecessary log message. I added an if statement to guard against that.