On Firefox, with hidden iframes, matchMedia returns null, thus trying to access .matches crashes things. Added extra check to make sure we stay up and running.