Fixed coffeescript issue

Made sure the getIcon issue returns early if data is undefined.