• Eulyeon Ko's avatar
    Add guard for falsey values · 984d8383
    Eulyeon Ko authored
    gl-emoji, a web component, may lack data-name attribute sometimes
    and this can cause getEmoji()/searchEmoji() -
    to receive undefined value when initializing emoji,
    leading "toLowerCase()" to be called on undefined value.
    (which in turn causes console error)
    
    Returning null when query isn't defined in these functions -
    solves the above problem.
    984d8383
emoji_spec.js 13.6 KB