Merge "fix NPE when closing tab"