world client: always return non null or throw an error
This commit is contained in:
@@ -67,7 +67,7 @@ public class WorldClient
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
logger.debug("Error looking up worlds: {}", response);
|
||||
return null;
|
||||
throw new IOException("unsuccessful response looking up worlds");
|
||||
}
|
||||
|
||||
InputStream in = response.body().byteStream();
|
||||
|
||||
@@ -119,13 +119,6 @@ public class DefaultWorldPlugin extends Plugin
|
||||
try
|
||||
{
|
||||
final WorldResult worldResult = worldClient.lookupWorlds();
|
||||
|
||||
if (worldResult == null)
|
||||
{
|
||||
log.warn("Failed to lookup worlds.");
|
||||
return;
|
||||
}
|
||||
|
||||
final World world = worldResult.findWorld(correctedWorld);
|
||||
|
||||
if (world != null)
|
||||
|
||||
@@ -514,14 +514,10 @@ public class WorldHopperPlugin extends Plugin
|
||||
try
|
||||
{
|
||||
WorldResult worldResult = worldClient.lookupWorlds();
|
||||
|
||||
if (worldResult != null)
|
||||
{
|
||||
worldResult.getWorlds().sort(Comparator.comparingInt(World::getId));
|
||||
this.worldResult = worldResult;
|
||||
this.lastFetch = Instant.now();
|
||||
updateList();
|
||||
}
|
||||
worldResult.getWorlds().sort(Comparator.comparingInt(World::getId));
|
||||
this.worldResult = worldResult;
|
||||
this.lastFetch = Instant.now();
|
||||
updateList();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user