Added check for NULL session on create_window.