Closed
Description
I get crashreports caused by a NullPointerException in OperatorZip's tick() method. You find the stacktrace and my code, causing the problem below.
The responsible line in tick() method is
RxRingBuffer buffer = ((InnerSubscriber) observers[i]).items;
where observers[i] seems to be null.
The app crashes only rarely on one device, which I don't have acces to (Samsung S3, Android 4.3). The reason seems to be, that the property missedProducer
in ProducerArbiter
must be set, which is never the case on my devices.
We're not in production yet, so I can not tell how many other devices will show this error.
Stacktrace:
0 java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
1 at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
2 at rx.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:98)
3 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
4 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
5 at java.lang.Thread.run(Thread.java:841)
6 Caused by: java.lang.NullPointerException
7 at rx.internal.operators.OperatorZip$Zip.tick(OperatorZip.java:237)
8 at rx.internal.operators.OperatorZip$ZipProducer.request(OperatorZip.java:175)
9 at rx.internal.producers.ProducerArbiter.emitLoop(ProducerArbiter.java:181)
10 at rx.internal.producers.ProducerArbiter.request(ProducerArbiter.java:69)
11 at rx.internal.operators.OperatorConcat$ConcatSubscriber.requestFromChild(OperatorConcat.java:118)
12 at rx.internal.operators.OperatorConcat$ConcatSubscriber.access$100(OperatorConcat.java:79)
13 at rx.internal.operators.OperatorConcat$ConcatProducer.request(OperatorConcat.java:74)
14 at rx.internal.producers.ProducerArbiter.request(ProducerArbiter.java:66)
15 at rx.internal.operators.OperatorSubscribeOn$1$1$1$1$1.call(OperatorSubscribeOn.java:94)
16 at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
17 ... 4 more
This is the code causing the problem: Get Observable<List<ContainerEntity>>
, map each container entity to my actual container model. flatmap is used to split my list into single items.
getContainerEntities()
.flatMap(containerEntities ->
Observable.from(containerEntities))
.concatMap(containerEntity ->
mDashboardMapper.mapContainerEntity(containerEntity))
.onErrorResumeNext(throwable -> {
Log.e(TAG, throwable);
return Observable.empty();
});