ensure this.workerClass exists before instanceof check

This avoids an error I was running into in a node environment:

```
TypeError: Right-hand side of 'instanceof' is not an object
```
This commit is contained in:
Corey Frang 2018-03-07 18:13:15 -05:00
parent 02c6002bb2
commit 9b8a8647f0

View file

@ -83,7 +83,7 @@ class CentralDispatch extends SharedDispatch {
const provider = this.services[service];
return provider && {
provider,
isRemote: provider instanceof this.workerClass
isRemote: Boolean(this.workerClass && provider instanceof this.workerClass)
};
}