Fixes MDL-45096

Prevents JS errors in some themes when admin block is hidden