Added a Null Pointer handler in ToggleNightMode() to see if it mitigates a recently noticed bug 721. This does not fix the underlying problem, which still needs investigating and then addressing.