Commit 0a6a9c1 1 parent c53378b commit 0a6a9c1 Copy full SHA for 0a6a9c1
File tree 1 file changed +6
-7
lines changed
common/src/main/java/net/william278/husktowns/database
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -370,16 +370,15 @@ public List<Town> getAllTowns() throws IllegalStateException {
370
370
FROM `%town_data%`""" ))) {
371
371
final ResultSet resultSet = statement .executeQuery ();
372
372
while (resultSet .next ()) {
373
- final String data = new String (resultSet .getBytes ("data" ), StandardCharsets .UTF_8 );
374
- final Town town = plugin .getTownFromJson (data );
375
- if (town != null ) {
376
- town .setId (resultSet .getInt ("id" ));
377
- towns .add (town );
378
- }
373
+ final Town town = plugin .getTownFromJson (
374
+ new String (resultSet .getBytes ("data" ), StandardCharsets .UTF_8 )
375
+ );
376
+ town .setId (resultSet .getInt ("id" ));
377
+ towns .add (town );
379
378
}
380
379
}
381
380
} catch (SQLException | JsonSyntaxException e ) {
382
- plugin . log ( Level . SEVERE , "Failed to fetch all town data from table" , e );
381
+ throw new IllegalStateException ( "Failed to fetch all town data from table" , e );
383
382
}
384
383
return towns ;
385
384
}
You can’t perform that action at this time.
0 commit comments