{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/22840057","id":22840057,"diff_hunk":"@@ -55,6 +55,9 @@ public synchronized boolean isUnsubscribed() {\n      *          the {@link Subscription} to add\n      */\n     public void add(final Subscription s) {\n+        if (s == null) {\n+            throw new IllegalArgumentException(\"Added Subscription cannot be null.\");","path":"src/main/java/rx/subscriptions/CompositeSubscription.java","position":null,"original_position":5,"commit_id":"224cafb256ad1f0c34741cd1bb094bc4d9584142","original_commit_id":"ed63daa9520b06f574eb387a43c2c2620bc70134","user":{"login":"jnlopar","id":1297988,"avatar_url":"https://avatars.githubusercontent.com/u/1297988?v=3","gravatar_id":"","url":"https://api.github.com/users/jnlopar","html_url":"https://github.com/jnlopar","followers_url":"https://api.github.com/users/jnlopar/followers","following_url":"https://api.github.com/users/jnlopar/following{/other_user}","gists_url":"https://api.github.com/users/jnlopar/gists{/gist_id}","starred_url":"https://api.github.com/users/jnlopar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnlopar/subscriptions","organizations_url":"https://api.github.com/users/jnlopar/orgs","repos_url":"https://api.github.com/users/jnlopar/repos","events_url":"https://api.github.com/users/jnlopar/events{/privacy}","received_events_url":"https://api.github.com/users/jnlopar/received_events","type":"User","site_admin":false},"body":"done! :)","created_at":"2015-01-13T02:31:53Z","updated_at":"2015-01-13T02:31:53Z","html_url":"https://github.com/ReactiveX/RxJava/pull/2447#discussion_r22840057","pull_request_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447","_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/22840057"},"html":{"href":"https://github.com/ReactiveX/RxJava/pull/2447#discussion_r22840057"},"pull_request":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447","id":27233740,"html_url":"https://github.com/ReactiveX/RxJava/pull/2447","diff_url":"https://github.com/ReactiveX/RxJava/pull/2447.diff","patch_url":"https://github.com/ReactiveX/RxJava/pull/2447.patch","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2447","number":2447,"state":"open","locked":false,"title":"Fail early if a null subscription is added to a CompositeSubscription.","user":{"login":"jnlopar","id":1297988,"avatar_url":"https://avatars.githubusercontent.com/u/1297988?v=3","gravatar_id":"","url":"https://api.github.com/users/jnlopar","html_url":"https://github.com/jnlopar","followers_url":"https://api.github.com/users/jnlopar/followers","following_url":"https://api.github.com/users/jnlopar/following{/other_user}","gists_url":"https://api.github.com/users/jnlopar/gists{/gist_id}","starred_url":"https://api.github.com/users/jnlopar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnlopar/subscriptions","organizations_url":"https://api.github.com/users/jnlopar/orgs","repos_url":"https://api.github.com/users/jnlopar/repos","events_url":"https://api.github.com/users/jnlopar/events{/privacy}","received_events_url":"https://api.github.com/users/jnlopar/received_events","type":"User","site_admin":false},"body":"Otherwise, it'll just fail late when unsubscribing, which is much harder to trace.\r\n\r\nI discovered this while writing  a unit test, when I didn't properly mock out a method to return a valid Observable. Seems like it would be more likely to happen in test code than production, but still could be a stumbling block that's hard to track down if there's a bug in app logic adding a null subscription.","created_at":"2015-01-12T22:53:43Z","updated_at":"2015-01-13T02:31:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee320a67013d4bbd362b5b99c47d6237bfde00bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447/commits","review_comments_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447/comments","review_comment_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/2447/comments","statuses_url":"https://api.github.com/repos/ReactiveX/RxJava/statuses/224cafb256ad1f0c34741cd1bb094bc4d9584142","head":{"label":"jnlopar:1.x","ref":"1.x","sha":"224cafb256ad1f0c34741cd1bb094bc4d9584142","user":{"login":"jnlopar","id":1297988,"avatar_url":"https://avatars.githubusercontent.com/u/1297988?v=3","gravatar_id":"","url":"https://api.github.com/users/jnlopar","html_url":"https://github.com/jnlopar","followers_url":"https://api.github.com/users/jnlopar/followers","following_url":"https://api.github.com/users/jnlopar/following{/other_user}","gists_url":"https://api.github.com/users/jnlopar/gists{/gist_id}","starred_url":"https://api.github.com/users/jnlopar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnlopar/subscriptions","organizations_url":"https://api.github.com/users/jnlopar/orgs","repos_url":"https://api.github.com/users/jnlopar/repos","events_url":"https://api.github.com/users/jnlopar/events{/privacy}","received_events_url":"https://api.github.com/users/jnlopar/received_events","type":"User","site_admin":false},"repo":{"id":29160858,"name":"RxJava","full_name":"jnlopar/RxJava","owner":{"login":"jnlopar","id":1297988,"avatar_url":"https://avatars.githubusercontent.com/u/1297988?v=3","gravatar_id":"","url":"https://api.github.com/users/jnlopar","html_url":"https://github.com/jnlopar","followers_url":"https://api.github.com/users/jnlopar/followers","following_url":"https://api.github.com/users/jnlopar/following{/other_user}","gists_url":"https://api.github.com/users/jnlopar/gists{/gist_id}","starred_url":"https://api.github.com/users/jnlopar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnlopar/subscriptions","organizations_url":"https://api.github.com/users/jnlopar/orgs","repos_url":"https://api.github.com/users/jnlopar/repos","events_url":"https://api.github.com/users/jnlopar/events{/privacy}","received_events_url":"https://api.github.com/users/jnlopar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jnlopar/RxJava","description":"RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.","fork":true,"url":"https://api.github.com/repos/jnlopar/RxJava","forks_url":"https://api.github.com/repos/jnlopar/RxJava/forks","keys_url":"https://api.github.com/repos/jnlopar/RxJava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jnlopar/RxJava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jnlopar/RxJava/teams","hooks_url":"https://api.github.com/repos/jnlopar/RxJava/hooks","issue_events_url":"https://api.github.com/repos/jnlopar/RxJava/issues/events{/number}","events_url":"https://api.github.com/repos/jnlopar/RxJava/events","assignees_url":"https://api.github.com/repos/jnlopar/RxJava/assignees{/user}","branches_url":"https://api.github.com/repos/jnlopar/RxJava/branches{/branch}","tags_url":"https://api.github.com/repos/jnlopar/RxJava/tags","blobs_url":"https://api.github.com/repos/jnlopar/RxJava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jnlopar/RxJava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jnlopar/RxJava/git/refs{/sha}","trees_url":"https://api.github.com/repos/jnlopar/RxJava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jnlopar/RxJava/statuses/{sha}","languages_url":"https://api.github.com/repos/jnlopar/RxJava/languages","stargazers_url":"https://api.github.com/repos/jnlopar/RxJava/stargazers","contributors_url":"https://api.github.com/repos/jnlopar/RxJava/contributors","subscribers_url":"https://api.github.com/repos/jnlopar/RxJava/subscribers","subscription_url":"https://api.github.com/repos/jnlopar/RxJava/subscription","commits_url":"https://api.github.com/repos/jnlopar/RxJava/commits{/sha}","git_commits_url":"https://api.github.com/repos/jnlopar/RxJava/git/commits{/sha}","comments_url":"https://api.github.com/repos/jnlopar/RxJava/comments{/number}","issue_comment_url":"https://api.github.com/repos/jnlopar/RxJava/issues/comments/{number}","contents_url":"https://api.github.com/repos/jnlopar/RxJava/contents/{+path}","compare_url":"https://api.github.com/repos/jnlopar/RxJava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jnlopar/RxJava/merges","archive_url":"https://api.github.com/repos/jnlopar/RxJava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jnlopar/RxJava/downloads","issues_url":"https://api.github.com/repos/jnlopar/RxJava/issues{/number}","pulls_url":"https://api.github.com/repos/jnlopar/RxJava/pulls{/number}","milestones_url":"https://api.github.com/repos/jnlopar/RxJava/milestones{/number}","notifications_url":"https://api.github.com/repos/jnlopar/RxJava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jnlopar/RxJava/labels{/name}","releases_url":"https://api.github.com/repos/jnlopar/RxJava/releases{/id}","created_at":"2015-01-12T22:42:29Z","updated_at":"2015-01-13T02:27:00Z","pushed_at":"2015-01-13T02:27:00Z","git_url":"git://github.com/jnlopar/RxJava.git","ssh_url":"git@github.com:jnlopar/RxJava.git","clone_url":"https://github.com/jnlopar/RxJava.git","svn_url":"https://github.com/jnlopar/RxJava","homepage":"","size":364368,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"1.x"}},"base":{"label":"ReactiveX:1.x","ref":"1.x","sha":"b37c7ed133f5b10161d130f8cccc510a249e4d1d","user":{"login":"ReactiveX","id":6407041,"avatar_url":"https://avatars.githubusercontent.com/u/6407041?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"repo":{"id":7508411,"name":"RxJava","full_name":"ReactiveX/RxJava","owner":{"login":"ReactiveX","id":6407041,"avatar_url":"https://avatars.githubusercontent.com/u/6407041?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveX/RxJava","description":"RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.","fork":false,"url":"https://api.github.com/repos/ReactiveX/RxJava","forks_url":"https://api.github.com/repos/ReactiveX/RxJava/forks","keys_url":"https://api.github.com/repos/ReactiveX/RxJava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveX/RxJava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveX/RxJava/teams","hooks_url":"https://api.github.com/repos/ReactiveX/RxJava/hooks","issue_events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveX/RxJava/events","assignees_url":"https://api.github.com/repos/ReactiveX/RxJava/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveX/RxJava/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveX/RxJava/tags","blobs_url":"https://api.github.com/repos/ReactiveX/RxJava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveX/RxJava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveX/RxJava/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveX/RxJava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveX/RxJava/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveX/RxJava/languages","stargazers_url":"https://api.github.com/repos/ReactiveX/RxJava/stargazers","contributors_url":"https://api.github.com/repos/ReactiveX/RxJava/contributors","subscribers_url":"https://api.github.com/repos/ReactiveX/RxJava/subscribers","subscription_url":"https://api.github.com/repos/ReactiveX/RxJava/subscription","commits_url":"https://api.github.com/repos/ReactiveX/RxJava/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveX/RxJava/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/{number}","contents_url":"https://api.github.com/repos/ReactiveX/RxJava/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveX/RxJava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveX/RxJava/merges","archive_url":"https://api.github.com/repos/ReactiveX/RxJava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveX/RxJava/downloads","issues_url":"https://api.github.com/repos/ReactiveX/RxJava/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveX/RxJava/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveX/RxJava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveX/RxJava/releases{/id}","created_at":"2013-01-08T20:11:48Z","updated_at":"2015-01-12T23:04:40Z","pushed_at":"2015-01-12T22:35:13Z","git_url":"git://github.com/ReactiveX/RxJava.git","ssh_url":"git@github.com:ReactiveX/RxJava.git","clone_url":"https://github.com/ReactiveX/RxJava.git","svn_url":"https://github.com/ReactiveX/RxJava","homepage":"","size":364368,"stargazers_count":4151,"watchers_count":4151,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":613,"mirror_url":null,"open_issues_count":110,"forks":613,"open_issues":110,"watchers":4151,"default_branch":"1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447"},"html":{"href":"https://github.com/ReactiveX/RxJava/pull/2447"},"issue":{"href":"https://api.github.com/repos/ReactiveX/RxJava/issues/2447"},"comments":{"href":"https://api.github.com/repos/ReactiveX/RxJava/issues/2447/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/2447/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveX/RxJava/statuses/224cafb256ad1f0c34741cd1bb094bc4d9584142"}}}}