Add guard for falsey values
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.
Showing
Please register or sign in to comment