Fix possible NPE seen in log from TISTUD-5756 NPE when closing a project