• 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
index.js 8.1 KB