Fix bug DNN-5637: also check whether active tab is null.