diff --git a/spec/operators/skipUntil-spec.ts b/spec/operators/skipUntil-spec.ts index 48e2752ddb..d8f06e3393 100644 --- a/spec/operators/skipUntil-spec.ts +++ b/spec/operators/skipUntil-spec.ts @@ -30,6 +30,16 @@ describe('skipUntil', () => { expectSubscriptions(skip.subscriptions).toBe(skipSubs); }); + it('should emit elements after a synchronous notifier emits', () => { + const values: string[] = []; + + of('a', 'b').pipe(skipUntil(of('x'))).subscribe( + value => values.push(value), + err => { throw err; }, + () => expect(values).to.deep.equal(['a', 'b']) + ); + }); + it('should raise an error if notifier throws and source is hot', () => { const e1 = hot('--a--b--c--d--e--|'); const e1subs = '^ ! '; diff --git a/src/internal/operators/skipUntil.ts b/src/internal/operators/skipUntil.ts index 24f40ee350..383847f97b 100644 --- a/src/internal/operators/skipUntil.ts +++ b/src/internal/operators/skipUntil.ts @@ -57,7 +57,9 @@ class SkipUntilSubscriber extends OuterSubscriber { outerIndex: number, innerIndex: number, innerSub: InnerSubscriber): void { this.hasValue = true; - this.innerSubscription.unsubscribe(); + if (this.innerSubscription) { + this.innerSubscription.unsubscribe(); + } } notifyComplete() {