{"action":"created","issue":{"url":"https://api.github.com/repos/PocketMine/PocketMine-MP/issues/4205","repository_url":"https://api.github.com/repos/PocketMine/PocketMine-MP","labels_url":"https://api.github.com/repos/PocketMine/PocketMine-MP/issues/4205/labels{/name}","comments_url":"https://api.github.com/repos/PocketMine/PocketMine-MP/issues/4205/comments","events_url":"https://api.github.com/repos/PocketMine/PocketMine-MP/issues/4205/events","html_url":"https://github.com/PocketMine/PocketMine-MP/pull/4205","id":159836291,"number":4205,"title":"Fix a getName() on null bug","user":{"login":"robske110","id":16020100,"avatar_url":"https://avatars.githubusercontent.com/u/16020100?v=3","gravatar_id":"","url":"https://api.github.com/users/robske110","html_url":"https://github.com/robske110","followers_url":"https://api.github.com/users/robske110/followers","following_url":"https://api.github.com/users/robske110/following{/other_user}","gists_url":"https://api.github.com/users/robske110/gists{/gist_id}","starred_url":"https://api.github.com/users/robske110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robske110/subscriptions","organizations_url":"https://api.github.com/users/robske110/orgs","repos_url":"https://api.github.com/users/robske110/repos","events_url":"https://api.github.com/users/robske110/events{/privacy}","received_events_url":"https://api.github.com/users/robske110/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-12T16:45:01Z","updated_at":"2016-06-16T15:03:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PocketMine/PocketMine-MP/pulls/4205","html_url":"https://github.com/PocketMine/PocketMine-MP/pull/4205","diff_url":"https://github.com/PocketMine/PocketMine-MP/pull/4205.diff","patch_url":"https://github.com/PocketMine/PocketMine-MP/pull/4205.patch"},"body":"I don't know exactly when this is happening. But it seems to happen if a player's spawnposition is in a level wich was previously loaded, but then unloaded. (Then the next autosave gets called => save() gets a level wich is closed therefore the provider has became (probably even destructed)  null wich triggers this getName() on null.)\r\n**We should consider checking on all level get functions that are using the provider variable to check if the provider is not null (level not closed) for less plugin crashes**\r\n\r\nHere is a Traceback wich helped me:\r\n```java\r\n2016-05-29 [19:07:55] [Server thread/CRITICAL]: Error: \"Call to a member function getName() on null\" (EXCEPTION) in \"/src/pocketmine/level/Level\" at line 2995\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #0 /src/pocketmine/Player(3989): pocketmine\\Player-&gt;save(boolean)\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #1 /src/pocketmine/Server(2473): pocketmine\\Player-&gt;close(pocketmine\\event\\TranslationContainer ..e%multiplayer.player.left, string Server closed)\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #2 /src/pocketmine/Server(2670): pocketmine\\Server-&gt;forceShutdown(boolean)\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #3 /src/pocketmine/Server(2611): pocketmine\\Server-&gt;crashDump(boolean)\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #4 /src/pocketmine/Server(2078): pocketmine\\Server-&gt;exceptionHandler(Error Error: Call to a member function getName() on null in phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/level/Level.php:2995.Stack trace:.#0 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/Player.php(4076): pocketmine\\level\\Level-&gt;getName().#1 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/Server.php(2829): pocketmine\\Player-&gt;save(true).#2 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/Server.php(3015): pocketmine\\Server-&gt;doAutoSave().#3 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/Server.php(2683): pocketmine\\Server-&gt;tick().#4 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/Server.php(2561): pocketmine\\Server-&gt;tickProcessor().#5 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/Server.php(2076): pocketmine\\Server-&gt;start().#6 phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/PocketMine.php(467): pocketmine\\Server-&gt;__construct(Object(pocketmine\\CompatibleClassLoader), Object(pocketmine\\utils\\MainLogger), 'phar:///home/pm...', '/home/pm1/', '/home/pm1/plugi...', 'unknown').#7 /home/pm1/PocketMine-MP.phar(1): require_once('phar:///home/pm...').#8 {main})\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #5 /src/pocketmine/PocketMine(467): pocketmine\\Server-&gt;__construct(pocketmine\\CompatibleClassLoader object, pocketmine\\utils\\MainLogger object, string phar:///home/pm1/PocketMine-MP.phar/, string /home/pm1/, string /home/pm1/plugins/, string unknown)\r\n2016-05-29 [19:07:55] [Server thread/DEBUG]: #6 (1): require_once(string phar:///home/pm1/PocketMine-MP.phar/src/pocketmine/PocketMine.php)\r\n2016-05-29 [19:07:55] [Server thread/EMERGENCY]: Crashed while crashing, killing process\r\n```"},"comment":{"url":"https://api.github.com/repos/PocketMine/PocketMine-MP/issues/comments/226513009","html_url":"https://github.com/PocketMine/PocketMine-MP/pull/4205#issuecomment-226513009","issue_url":"https://api.github.com/repos/PocketMine/PocketMine-MP/issues/4205","id":226513009,"user":{"login":"XtremePlayzCODE","id":15068374,"avatar_url":"https://avatars.githubusercontent.com/u/15068374?v=3","gravatar_id":"","url":"https://api.github.com/users/XtremePlayzCODE","html_url":"https://github.com/XtremePlayzCODE","followers_url":"https://api.github.com/users/XtremePlayzCODE/followers","following_url":"https://api.github.com/users/XtremePlayzCODE/following{/other_user}","gists_url":"https://api.github.com/users/XtremePlayzCODE/gists{/gist_id}","starred_url":"https://api.github.com/users/XtremePlayzCODE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XtremePlayzCODE/subscriptions","organizations_url":"https://api.github.com/users/XtremePlayzCODE/orgs","repos_url":"https://api.github.com/users/XtremePlayzCODE/repos","events_url":"https://api.github.com/users/XtremePlayzCODE/events{/privacy}","received_events_url":"https://api.github.com/users/XtremePlayzCODE/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T15:03:42Z","updated_at":"2016-06-16T15:03:42Z","body":"xD `2016-05-29 [19:07:55] [Server thread/EMERGENCY]: Crashed while crashing, killing process`\r\nHow can it crash while crashing?\r\nAnyways, I tried this out and it works good. Thanks! It should be merged"}}
{"actor":{"display_login":"XtremePlayzCODE"}}