Skip to content

2.x/3.x - NPE when debouncing empty source #6558

@hluhovskyi

Description

@hluhovskyi

Hey there!
I've faced with an issue when debouncing empty source it leads NPE. Here is simple test which demonstrates a problem:

@Test
public void debounceOnEmpty() {
    Observable.empty().debounce(new Function<Object, ObservableSource<Object>>() {
        @Override
        public ObservableSource<Object> apply(Object o) {
            return Observable.just(new Object());
        }
    }).subscribe();
}

Issue also touches Flowable in the same way. RxJava version is 2.2.7 however it is also reproducible for latest 3.x.

I am going to create PR with a fix soon for both of versions, let's keep this ticket to track a state of the issue.

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