```js
return result && result.then ? result : undefined;
```