cover null case for belongsTo relationship

I was getting an error:

    TypeError: Cannot read property 'clientId' of null

The error was caused by the fact that this statement doesn't protect against a `null` id:

    if (typeof id === 'object') {
      return store.findByClientId(type, id.clientId);
    }

This pull request adds the null check, and also a test.