diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index b93f1621cfa..65f348e9b18 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -3745,7 +3745,8 @@ private boolean isInternalImplementation(Object o) { if (o instanceof AtomicObserver) return true; // we treat the following package as "internal" and don't wrap it - return o.getClass().getPackage().getName().startsWith("rx.operators"); + Package p = o.getClass().getPackage(); // it can be null + return p != null && p.getName().startsWith("rx.operators"); } public static class UnitTest {