Pterodactyl4J: Getting NullPointerException when getting allocation from ApplicationServer

Hey. I’m receiving a NullPointer when I do

Allocation allocation = server.retrieveAllocation().execute();
String ip = allocation.getIP() + ":" + allocation.getPort(); // <-- Error Here

I’m not sure why this is happening, I think its only happening with some servers, most are working, this and a few others aren’t. I wouldn’t think that not using Async would be a cause? If you could help that would be great!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (17 by maintainers)

Most upvoted comments

I’m loading up my IDE now, I think its just allocations, I’ll check. This might take me a few minutes so…

Edit: I think its just allocations because I’m getting the server’s name perfectly fine.

Edit 2: Yeah so I think its just Allocations because I run this just a few methods earlier, which works:

player.sendMessage(new TextComponent(server.getName() + " is online, sending you there now."));
ServerUtils.connect(player, server);