Skip to content

Commit 224cafb

Browse files
committed
IllegalArgumentException > NPE
1 parent ed63daa commit 224cafb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/rx/subscriptions/CompositeSubscription.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public synchronized boolean isUnsubscribed() {
5656
*/
5757
public void add(final Subscription s) {
5858
if (s == null) {
59-
throw new IllegalArgumentException("Added Subscription cannot be null.");
59+
throw new NullPointerException("Added Subscription cannot be null.");
6060
}
6161
Subscription unsubscribe = null;
6262
synchronized (this) {

src/test/java/rx/subscriptions/CompositeSubscriptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public void testTryRemoveIfNotIn() {
338338
csub.remove(csub1); // try removing agian
339339
}
340340

341-
@Test(expected = IllegalArgumentException.class)
341+
@Test(expected = NullPointerException.class)
342342
public void testAddingNullSubscriptionIllegal() {
343343
CompositeSubscription csub = new CompositeSubscription();
344344
csub.add(null);

0 commit comments

Comments
 (0)