Prevent coverting of undefined to string in getStyles function