Prevent `Uncaught TypeError: Cannot call method 'disable' of undefined`