{"action":"closed","issue":{"url":"https://api.github.com/repos/anshooarora/extentreports-java/issues/666","repository_url":"https://api.github.com/repos/anshooarora/extentreports-java","labels_url":"https://api.github.com/repos/anshooarora/extentreports-java/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/anshooarora/extentreports-java/issues/666/comments","events_url":"https://api.github.com/repos/anshooarora/extentreports-java/issues/666/events","html_url":"https://github.com/anshooarora/extentreports-java/issues/666","id":186089460,"number":666,"title":"Null pointer exception unless the report is attached","user":{"login":"email2vimalraj","id":1214686,"avatar_url":"https://avatars.githubusercontent.com/u/1214686?v=3","gravatar_id":"","url":"https://api.github.com/users/email2vimalraj","html_url":"https://github.com/email2vimalraj","followers_url":"https://api.github.com/users/email2vimalraj/followers","following_url":"https://api.github.com/users/email2vimalraj/following{/other_user}","gists_url":"https://api.github.com/users/email2vimalraj/gists{/gist_id}","starred_url":"https://api.github.com/users/email2vimalraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/email2vimalraj/subscriptions","organizations_url":"https://api.github.com/users/email2vimalraj/orgs","repos_url":"https://api.github.com/users/email2vimalraj/repos","events_url":"https://api.github.com/users/email2vimalraj/events{/privacy}","received_events_url":"https://api.github.com/users/email2vimalraj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-29T17:10:08Z","updated_at":"2016-10-30T05:54:51Z","closed_at":"2016-10-30T05:54:51Z","body":"Extent version: v3.0.0\r\n\r\nI'm creating an instance for the `ExtentReports` at the beginning of the execution and I don't want to attach any reporter unless the execution is completed. So I'm attaching the reporter at the end of the execution. So I'm performing like this:\r\n\r\n**On Execution Start**\r\n```java\r\nExtentReports extent = new ExtentReports();\r\n```\r\n\r\n**On Test start**\r\n```java\r\nExtentTest test = extent.createTest(\"Test Name\");  // Getting null pointer exception here\r\n```\r\n\r\n**On Execution Complete**\r\n```java\r\nExtentHtmlReporter reporter = new ExtentHtmlReporter(filePath);\r\nextent.attachReporter(reporter);\r\nextent.flush();\r\nextent.close();\r\n```\r\n\r\nThe `Null pointer exception` is thrown while creating the test. To reproduce, execute the following:\r\n\r\n```java\r\n    public static void main(String[] args) {\r\n        ExtentReports extent = new ExtentReports();\r\n        ExtentTest test = extent.createTest(\"Test Name\");\r\n        test.pass(\"Passed\");\r\n\r\n        ExtentHtmlReporter reporter = new ExtentHtmlReporter(\"output/test.html\");\r\n        extent.attachReporter(reporter);\r\n        extent.flush();\r\n        extent.close();\r\n    }\r\n```"}}
{"actor":{"display_login":"anshooarora"}}