keystonejs/keystone — pull request #697 by ignlg (2014-11-04 09:57:00+00:00)
Title: Fix for user undefined after ajax remove item from list

After an ajax remove item call from the items list, with some lists, Admin UI crashes on `fetch` because user is undefined.

Delete operation returns a correct status and the item is removed correctly. I cannot reproduce the issue with every list but I've been able to reproduce it with one of our lists.

This change fixes this issue until a better solution.

The crash:

```

TypeError:
/node_modules/keystone/templates/mixins/rows.jade:5
3| mixin row(list, colums, item)
4| tr(id=item.id)
> 5| if !list.get('nodelete') && item.id !== user.id
6| td.control: a(href='/keystone/' + list.path + '?delete=' + item.id + csrf_query).control-delete
7| else if !list.get('nodelete')
8| td.control

Cannot read property 'id' of undefined
at Object.jade_mixins.row (:274:47)
at eval (:374:19)
at eval (:376:22)
...
```