(frontend) Fix NPE when closing a project