Prevent a blocking TypeError when closing a grid edit modal