payload: {"action":"created","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/5686","repository_url":"https://api.github.com/repos/libgdx/libgdx","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/5686/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/5686/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/5686/events","html_url":"https://github.com/libgdx/libgdx/issues/5686","id":461099161,"node_id":"MDU6SXNzdWU0NjEwOTkxNjE=","number":5686,"title":"SpriteBatch::end causes NullPointerException after drawing new TextureRegion()","user":{"login":"limbusdev","id":6540152,"node_id":"MDQ6VXNlcjY1NDAxNTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6540152?v=4","gravatar_id":"","url":"https://api.github.com/users/limbusdev","html_url":"https://github.com/limbusdev","followers_url":"https://api.github.com/users/limbusdev/followers","following_url":"https://api.github.com/users/limbusdev/following{/other_user}","gists_url":"https://api.github.com/users/limbusdev/gists{/gist_id}","starred_url":"https://api.github.com/users/limbusdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limbusdev/subscriptions","organizations_url":"https://api.github.com/users/limbusdev/orgs","repos_url":"https://api.github.com/users/limbusdev/repos","events_url":"https://api.github.com/users/limbusdev/events{/privacy}","received_events_url":"https://api.github.com/users/limbusdev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2019-06-26T17:41:11Z","updated_at":"2019-06-27T08:00:08Z","closed_at":"2019-06-27T06:55:35Z","author_association":"NONE","body":"#### Issue details\r\nUsing `batch.draw(...)` to draw a **TextureRegion** that was created with the default constructor, causes a NullPointerException. Since there is a default constructor `TextureRegion region = new TextureRegion()` I think this should not happen. If it should happen, the empty constructor should not be available.\r\n\r\n#### Reproduction steps/code\r\nRun this code:\r\n```java\r\nprivate TextureRegion region = new TextureRegion();\r\nprivate SpriteBatch batch = new SpriteBatch();\r\n\r\nprivate void draw()\r\n{\r\n  batch.begin();\r\n  batch.draw(region, 0f, 0f, 1024f, 512f);\r\n  batch.end();\r\n}\r\n```\r\n\r\nThis can be prevented by:\r\n\r\n```java\r\nprivate void draw()\r\n{\r\n  batch.begin();\r\n  if(region.getTexture() != null) { batch.draw(region, 0f, 0f, 1024f, 512f); }\r\n  batch.end();\r\n}\r\n```\r\n\r\n#### Version of LibGDX and/or relevant dependencies\r\n1.9.9\r\n\r\n#### Stacktrace\r\n```java\r\nException in thread \"LWJGL Application\" java.lang.NullPointerException\r\n\tat com.badlogic.gdx.graphics.g2d.SpriteBatch.flush(SpriteBatch.java:960)\r\n\tat com.badlogic.gdx.graphics.g2d.SpriteBatch.end(SpriteBatch.java:185)\r\n\tat de.limbusdev.guardianmonsters.ui.AScreen.drawBackground(AScreen.kt:64)\r\n\tat de.limbusdev.guardianmonsters.ui.AScreen.render(AScreen.kt:80)\r\n\tat com.badlogic.gdx.Game.render(Game.java:46)\r\n\tat com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225)\r\n\tat com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)\r\n```\r\n\r\n#### Please select the affected platforms\r\nI guess all."},"comment":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/comments/506237969","html_url":"https://github.com/libgdx/libgdx/issues/5686#issuecomment-506237969","issue_url":"https://api.github.com/repos/libgdx/libgdx/issues/5686","id":506237969,"node_id":"MDEyOklzc3VlQ29tbWVudDUwNjIzNzk2OQ==","user":{"login":"limbusdev","id":6540152,"node_id":"MDQ6VXNlcjY1NDAxNTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6540152?v=4","gravatar_id":"","url":"https://api.github.com/users/limbusdev","html_url":"https://github.com/limbusdev","followers_url":"https://api.github.com/users/limbusdev/followers","following_url":"https://api.github.com/users/limbusdev/following{/other_user}","gists_url":"https://api.github.com/users/limbusdev/gists{/gist_id}","starred_url":"https://api.github.com/users/limbusdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limbusdev/subscriptions","organizations_url":"https://api.github.com/users/limbusdev/orgs","repos_url":"https://api.github.com/users/limbusdev/repos","events_url":"https://api.github.com/users/limbusdev/events{/privacy}","received_events_url":"https://api.github.com/users/limbusdev/received_events","type":"User","site_admin":false},"created_at":"2019-06-27T08:00:08Z","updated_at":"2019-06-27T08:00:08Z","author_association":"NONE","body":"The fact that stunned me is, that the draw command did not fail. That made it a little bit hard, to find out what's happening. Thanks for improving the docs."}}
other: {"actor":{"display_login":"limbusdev"}}