Check whether the params object is undefined or not to prevent js error

See: https://github.com/GigaOM/legacy-pro/issues/2997
Merge pull request #65 from borkweb/2997-autocomplete

Check whether the params object is undefined or not to prevent js error