Prevent error when document does not cotain _links

According to the spec 

```
{}
```

is a valid document, but when fed a doc without a `_link` element the browser chokes. Not sure if this is the best way to fix it but it worked for https://github.com/plexus/yakports