Fixed crash after copy/paste of view and case