diff --git a/packages/effection/src/resource.js b/packages/effection/src/resource.js index 6390d6017..69c78d71d 100644 --- a/packages/effection/src/resource.js +++ b/packages/effection/src/resource.js @@ -5,7 +5,7 @@ let symbol = Symbol("resource"); export function contextOf(resource) { if(resource instanceof ExecutionContext) { return resource; - } else if(typeof(resource) === "object" || typeof(resource) === "function") { + } else if(resource != null) { return resource[symbol]; } } diff --git a/packages/effection/tests/resources.test.js b/packages/effection/tests/resources.test.js index 4f8470d33..1cbfc0ed1 100644 --- a/packages/effection/tests/resources.test.js +++ b/packages/effection/tests/resources.test.js @@ -107,4 +107,16 @@ describe('Returning resources', () => { }); }); }); + + describe('null operations', () => { + beforeEach(() => { + return execution = main(function*() { + yield Promise.resolve(null); + }); + }); + it('completes', () => { + expect(execution.state).toEqual('completed'); + }); + }); + });