{"action":"created","comment":{"url":"https://api.github.com/repos/ayush2k/securbank/pulls/comments/84815538","pull_request_review_id":5568847,"id":84815538,"diff_hunk":"@@ -80,56 +96,140 @@ public String newTransactionForm(Model model){\n \t\treturn \"external/createtransaction\";\n \t}\n \t\n+\t@GetMapping(\"/user/transaction/otp\")\n+\tpublic String createTransactionOtp(Model model){\n+\t\tmodel.addAttribute(\"transaction\", new Transaction());\n+\t\tlogger.info(\"GET request: Extrernal user transaction generate OTP\");\n+\t\tUser currentUser = userService.getCurrentUser();\n+\t\totpService.createOtpForUser(currentUser);\n+\t\t\n+\t\treturn \"redirect:/user/createtransaction\";\n+\t}\n+\t\n \t@PostMapping(\"/user/createtransaction\")\n     public String submitNewTransaction(@ModelAttribute Transaction transaction, BindingResult bindingResult) {\n \t\tlogger.info(\"POST request: Submit transaction\");\n \t\t\n \t\ttransactionFormValidator.validate(transaction, bindingResult);\n \t\t\n+\t\tString otp = otpService.getOtpByUser(transaction.getAccount().getUser()).getCode();","path":"src/main/java/securbank/controller/ExternalUserController.java","position":75,"original_position":75,"commit_id":"503d9ebcd2052a337bc2d62b83e34d95f9fd53fd","original_commit_id":"503d9ebcd2052a337bc2d62b83e34d95f9fd53fd","user":{"login":"Nikh13","id":5780739,"avatar_url":"https://avatars.githubusercontent.com/u/5780739?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikh13","html_url":"https://github.com/Nikh13","followers_url":"https://api.github.com/users/Nikh13/followers","following_url":"https://api.github.com/users/Nikh13/following{/other_user}","gists_url":"https://api.github.com/users/Nikh13/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikh13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikh13/subscriptions","organizations_url":"https://api.github.com/users/Nikh13/orgs","repos_url":"https://api.github.com/users/Nikh13/repos","events_url":"https://api.github.com/users/Nikh13/events{/privacy}","received_events_url":"https://api.github.com/users/Nikh13/received_events","type":"User","site_admin":false},"body":"We are getting transaction from user input. So its account object will always be null. This is leading to a null pointer exception. Im guessing this should be `userService.getCurrentUser()` instead of `transaction.getAccount().getUser()`","created_at":"2016-10-25T01:15:01Z","updated_at":"2016-10-25T01:15:01Z","html_url":"https://github.com/ayush2k/securbank/pull/109#discussion_r84815538","pull_request_url":"https://api.github.com/repos/ayush2k/securbank/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/ayush2k/securbank/pulls/comments/84815538"},"html":{"href":"https://github.com/ayush2k/securbank/pull/109#discussion_r84815538"},"pull_request":{"href":"https://api.github.com/repos/ayush2k/securbank/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/ayush2k/securbank/pulls/109","id":90679962,"html_url":"https://github.com/ayush2k/securbank/pull/109","diff_url":"https://github.com/ayush2k/securbank/pull/109.diff","patch_url":"https://github.com/ayush2k/securbank/pull/109.patch","issue_url":"https://api.github.com/repos/ayush2k/securbank/issues/109","number":109,"state":"open","locked":false,"title":"adds otp to transaction and transfer'","user":{"login":"Mitikaa","id":14308271,"avatar_url":"https://avatars.githubusercontent.com/u/14308271?v=3","gravatar_id":"","url":"https://api.github.com/users/Mitikaa","html_url":"https://github.com/Mitikaa","followers_url":"https://api.github.com/users/Mitikaa/followers","following_url":"https://api.github.com/users/Mitikaa/following{/other_user}","gists_url":"https://api.github.com/users/Mitikaa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mitikaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mitikaa/subscriptions","organizations_url":"https://api.github.com/users/Mitikaa/orgs","repos_url":"https://api.github.com/users/Mitikaa/repos","events_url":"https://api.github.com/users/Mitikaa/events{/privacy}","received_events_url":"https://api.github.com/users/Mitikaa/received_events","type":"User","site_admin":false},"body":"Resolves #110 \r\nDescription: otp for transaction and transfer sevices\r\n\r\n","created_at":"2016-10-24T19:49:28Z","updated_at":"2016-10-25T01:15:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbdf9fe1736188c834f68e6c9482f4e6083ef695","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ayush2k/securbank/pulls/109/commits","review_comments_url":"https://api.github.com/repos/ayush2k/securbank/pulls/109/comments","review_comment_url":"https://api.github.com/repos/ayush2k/securbank/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ayush2k/securbank/issues/109/comments","statuses_url":"https://api.github.com/repos/ayush2k/securbank/statuses/503d9ebcd2052a337bc2d62b83e34d95f9fd53fd","head":{"label":"Mitikaa:otp","ref":"otp","sha":"503d9ebcd2052a337bc2d62b83e34d95f9fd53fd","user":{"login":"Mitikaa","id":14308271,"avatar_url":"https://avatars.githubusercontent.com/u/14308271?v=3","gravatar_id":"","url":"https://api.github.com/users/Mitikaa","html_url":"https://github.com/Mitikaa","followers_url":"https://api.github.com/users/Mitikaa/followers","following_url":"https://api.github.com/users/Mitikaa/following{/other_user}","gists_url":"https://api.github.com/users/Mitikaa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mitikaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mitikaa/subscriptions","organizations_url":"https://api.github.com/users/Mitikaa/orgs","repos_url":"https://api.github.com/users/Mitikaa/repos","events_url":"https://api.github.com/users/Mitikaa/events{/privacy}","received_events_url":"https://api.github.com/users/Mitikaa/received_events","type":"User","site_admin":false},"repo":{"id":69196768,"name":"securbank","full_name":"Mitikaa/securbank","owner":{"login":"Mitikaa","id":14308271,"avatar_url":"https://avatars.githubusercontent.com/u/14308271?v=3","gravatar_id":"","url":"https://api.github.com/users/Mitikaa","html_url":"https://github.com/Mitikaa","followers_url":"https://api.github.com/users/Mitikaa/followers","following_url":"https://api.github.com/users/Mitikaa/following{/other_user}","gists_url":"https://api.github.com/users/Mitikaa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mitikaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mitikaa/subscriptions","organizations_url":"https://api.github.com/users/Mitikaa/orgs","repos_url":"https://api.github.com/users/Mitikaa/repos","events_url":"https://api.github.com/users/Mitikaa/events{/privacy}","received_events_url":"https://api.github.com/users/Mitikaa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mitikaa/securbank","description":"Secure Banking Project for CSE545","fork":true,"url":"https://api.github.com/repos/Mitikaa/securbank","forks_url":"https://api.github.com/repos/Mitikaa/securbank/forks","keys_url":"https://api.github.com/repos/Mitikaa/securbank/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mitikaa/securbank/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mitikaa/securbank/teams","hooks_url":"https://api.github.com/repos/Mitikaa/securbank/hooks","issue_events_url":"https://api.github.com/repos/Mitikaa/securbank/issues/events{/number}","events_url":"https://api.github.com/repos/Mitikaa/securbank/events","assignees_url":"https://api.github.com/repos/Mitikaa/securbank/assignees{/user}","branches_url":"https://api.github.com/repos/Mitikaa/securbank/branches{/branch}","tags_url":"https://api.github.com/repos/Mitikaa/securbank/tags","blobs_url":"https://api.github.com/repos/Mitikaa/securbank/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mitikaa/securbank/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mitikaa/securbank/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mitikaa/securbank/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mitikaa/securbank/statuses/{sha}","languages_url":"https://api.github.com/repos/Mitikaa/securbank/languages","stargazers_url":"https://api.github.com/repos/Mitikaa/securbank/stargazers","contributors_url":"https://api.github.com/repos/Mitikaa/securbank/contributors","subscribers_url":"https://api.github.com/repos/Mitikaa/securbank/subscribers","subscription_url":"https://api.github.com/repos/Mitikaa/securbank/subscription","commits_url":"https://api.github.com/repos/Mitikaa/securbank/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mitikaa/securbank/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mitikaa/securbank/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mitikaa/securbank/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mitikaa/securbank/contents/{+path}","compare_url":"https://api.github.com/repos/Mitikaa/securbank/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mitikaa/securbank/merges","archive_url":"https://api.github.com/repos/Mitikaa/securbank/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mitikaa/securbank/downloads","issues_url":"https://api.github.com/repos/Mitikaa/securbank/issues{/number}","pulls_url":"https://api.github.com/repos/Mitikaa/securbank/pulls{/number}","milestones_url":"https://api.github.com/repos/Mitikaa/securbank/milestones{/number}","notifications_url":"https://api.github.com/repos/Mitikaa/securbank/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mitikaa/securbank/labels{/name}","releases_url":"https://api.github.com/repos/Mitikaa/securbank/releases{/id}","deployments_url":"https://api.github.com/repos/Mitikaa/securbank/deployments","created_at":"2016-09-25T23:31:46Z","updated_at":"2016-09-25T23:31:47Z","pushed_at":"2016-10-24T23:46:17Z","git_url":"git://github.com/Mitikaa/securbank.git","ssh_url":"git@github.com:Mitikaa/securbank.git","clone_url":"https://github.com/Mitikaa/securbank.git","svn_url":"https://github.com/Mitikaa/securbank","homepage":null,"size":1596,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ayush2k:master","ref":"master","sha":"fdbcf24c7ce9ba0de8e1fc3a2b082a59413169df","user":{"login":"ayush2k","id":7220478,"avatar_url":"https://avatars.githubusercontent.com/u/7220478?v=3","gravatar_id":"","url":"https://api.github.com/users/ayush2k","html_url":"https://github.com/ayush2k","followers_url":"https://api.github.com/users/ayush2k/followers","following_url":"https://api.github.com/users/ayush2k/following{/other_user}","gists_url":"https://api.github.com/users/ayush2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ayush2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayush2k/subscriptions","organizations_url":"https://api.github.com/users/ayush2k/orgs","repos_url":"https://api.github.com/users/ayush2k/repos","events_url":"https://api.github.com/users/ayush2k/events{/privacy}","received_events_url":"https://api.github.com/users/ayush2k/received_events","type":"User","site_admin":false},"repo":{"id":66820582,"name":"securbank","full_name":"ayush2k/securbank","owner":{"login":"ayush2k","id":7220478,"avatar_url":"https://avatars.githubusercontent.com/u/7220478?v=3","gravatar_id":"","url":"https://api.github.com/users/ayush2k","html_url":"https://github.com/ayush2k","followers_url":"https://api.github.com/users/ayush2k/followers","following_url":"https://api.github.com/users/ayush2k/following{/other_user}","gists_url":"https://api.github.com/users/ayush2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ayush2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayush2k/subscriptions","organizations_url":"https://api.github.com/users/ayush2k/orgs","repos_url":"https://api.github.com/users/ayush2k/repos","events_url":"https://api.github.com/users/ayush2k/events{/privacy}","received_events_url":"https://api.github.com/users/ayush2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ayush2k/securbank","description":"Secure Banking Project for CSE545","fork":false,"url":"https://api.github.com/repos/ayush2k/securbank","forks_url":"https://api.github.com/repos/ayush2k/securbank/forks","keys_url":"https://api.github.com/repos/ayush2k/securbank/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ayush2k/securbank/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ayush2k/securbank/teams","hooks_url":"https://api.github.com/repos/ayush2k/securbank/hooks","issue_events_url":"https://api.github.com/repos/ayush2k/securbank/issues/events{/number}","events_url":"https://api.github.com/repos/ayush2k/securbank/events","assignees_url":"https://api.github.com/repos/ayush2k/securbank/assignees{/user}","branches_url":"https://api.github.com/repos/ayush2k/securbank/branches{/branch}","tags_url":"https://api.github.com/repos/ayush2k/securbank/tags","blobs_url":"https://api.github.com/repos/ayush2k/securbank/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ayush2k/securbank/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ayush2k/securbank/git/refs{/sha}","trees_url":"https://api.github.com/repos/ayush2k/securbank/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ayush2k/securbank/statuses/{sha}","languages_url":"https://api.github.com/repos/ayush2k/securbank/languages","stargazers_url":"https://api.github.com/repos/ayush2k/securbank/stargazers","contributors_url":"https://api.github.com/repos/ayush2k/securbank/contributors","subscribers_url":"https://api.github.com/repos/ayush2k/securbank/subscribers","subscription_url":"https://api.github.com/repos/ayush2k/securbank/subscription","commits_url":"https://api.github.com/repos/ayush2k/securbank/commits{/sha}","git_commits_url":"https://api.github.com/repos/ayush2k/securbank/git/commits{/sha}","comments_url":"https://api.github.com/repos/ayush2k/securbank/comments{/number}","issue_comment_url":"https://api.github.com/repos/ayush2k/securbank/issues/comments{/number}","contents_url":"https://api.github.com/repos/ayush2k/securbank/contents/{+path}","compare_url":"https://api.github.com/repos/ayush2k/securbank/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ayush2k/securbank/merges","archive_url":"https://api.github.com/repos/ayush2k/securbank/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ayush2k/securbank/downloads","issues_url":"https://api.github.com/repos/ayush2k/securbank/issues{/number}","pulls_url":"https://api.github.com/repos/ayush2k/securbank/pulls{/number}","milestones_url":"https://api.github.com/repos/ayush2k/securbank/milestones{/number}","notifications_url":"https://api.github.com/repos/ayush2k/securbank/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ayush2k/securbank/labels{/name}","releases_url":"https://api.github.com/repos/ayush2k/securbank/releases{/id}","deployments_url":"https://api.github.com/repos/ayush2k/securbank/deployments","created_at":"2016-08-29T07:13:35Z","updated_at":"2016-10-23T17:58:05Z","pushed_at":"2016-10-24T23:46:18Z","git_url":"git://github.com/ayush2k/securbank.git","ssh_url":"git@github.com:ayush2k/securbank.git","clone_url":"https://github.com/ayush2k/securbank.git","svn_url":"https://github.com/ayush2k/securbank","homepage":null,"size":1769,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":23,"forks":14,"open_issues":23,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ayush2k/securbank/pulls/109"},"html":{"href":"https://github.com/ayush2k/securbank/pull/109"},"issue":{"href":"https://api.github.com/repos/ayush2k/securbank/issues/109"},"comments":{"href":"https://api.github.com/repos/ayush2k/securbank/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/ayush2k/securbank/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/ayush2k/securbank/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ayush2k/securbank/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/ayush2k/securbank/statuses/503d9ebcd2052a337bc2d62b83e34d95f9fd53fd"}}}}
{"actor":{"display_login":"Nikh13"}}