Skip to content

source.Delay(observable) throws NullReferenceException if source emits a value immediately #1048

@christopherpaul

Description

@christopherpaul

The following code throws a NullReferenceException:

            var source = Observable.Return(1);
            var delayed = source.Delay(_ => Observable.Return(2));
            delayed.Subscribe(Console.Write); // NullReferenceException

This only seems to happen if source emits a value immediately on subscription.
The kind of observable used in the argument to Delay does not seem to make any difference.

System.Reactive v4.1.6
.NET Framework 4.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions