Fixed a bug due to accessing classList on null