Fixed crash when cancelling object context menu