Skip to content

2.x: ElementAt Operators in Observable and Flowable don't behave correctly on empty sources #4680

Closed
@vanniktech

Description

@vanniktech

elementAtOrError(1) on an empty source just leaves the new Single hanging without signalling onError():

Observable.empty()
    .elementAtOrError(1)
    .test()
    .assertFailure(NoSuchElementException.class);

elementAt(1) on an empty source just leaves the Maybe hanging without signalling onComplete():

Observable.empty()
    .elementAt(1)
    .test()
    .assertResult();

Just tested this against RC4. Happy to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions