Added 2 checks for undefined to prevent TypeErrors
Added 2 checks for undefined to prevent TypeErrors

It can happen that $active[0] is undefined. I added 2 checks for undefined to prevent the TypeErrors thrown because of this.
mike-north/materialize,onlyurei/materialize,ccloli/materialize,mike-north/materialize,ZiperRom1/materialize,digitalkaoz/materialize,ra-tes/style-guide,mihaibogdan10/materialize,ManuZiD/materialize,ccloli/materialize,philipraets/materialize,hustcer/materialize,apolzon/materialize,poetic/meteor-materialize-scss,mihaibogdan10/materialize,josecarlosweb/materialize,hustcer/materialize,tangposmarvin/materialize,INGCRENGIFO/materialize,gokuldh/materialize,onlyurei/materialize,devgrok/materialize,NicolasAndersen/materialize,INGCRENGIFO/materialize,poetic/meteor-materialize-scss,tomscholz/materialize,ManuZiD/materialize,rlugojr/materialize,gokuldh/materialize,ZiperRom1/materialize,tangposmarvin/materialize,apolzon/materialize,philipraets/materialize,DonHartman/materialize,Dogfalo/materialize,NicolasAndersen/materialize,josecarlosweb/materialize,ra-tes/style-guide,tomscholz/materialize,devgrok/materialize,zhenhua32/materialize,rlugojr/materialize,poetic/materialize,DonHartman/materialize,poetic/materialize,digitalkaoz/materialize,zhenhua32/materialize,Dogfalo/materialize