assert to shut the warnings up, the exception is caught already
This commit is contained in:
@@ -24,6 +24,7 @@ public class GetDiscordInviteByGuildId implements EndpointHandler {
|
|||||||
public GetDiscordInviteByGuildId() {
|
public GetDiscordInviteByGuildId() {
|
||||||
String invitesDisabledTemplate = null;
|
String invitesDisabledTemplate = null;
|
||||||
try (InputStream resource = this.getClass().getResourceAsStream("/template/invites-paused.html")) {
|
try (InputStream resource = this.getClass().getResourceAsStream("/template/invites-paused.html")) {
|
||||||
|
assert resource != null;
|
||||||
invitesDisabledTemplate = new String(resource.readAllBytes());
|
invitesDisabledTemplate = new String(resource.readAllBytes());
|
||||||
} catch (IOException | NullPointerException e) {
|
} catch (IOException | NullPointerException e) {
|
||||||
Main.LOGGER.warn("Failed to load template for invites disabled page", e);
|
Main.LOGGER.warn("Failed to load template for invites disabled page", e);
|
||||||
@@ -32,6 +33,7 @@ public class GetDiscordInviteByGuildId implements EndpointHandler {
|
|||||||
|
|
||||||
String botNotInGuildTemplate = null;
|
String botNotInGuildTemplate = null;
|
||||||
try (InputStream resource = this.getClass().getResourceAsStream("/template/guild-not-supported.html")) {
|
try (InputStream resource = this.getClass().getResourceAsStream("/template/guild-not-supported.html")) {
|
||||||
|
assert resource != null;
|
||||||
botNotInGuildTemplate = new String(resource.readAllBytes());
|
botNotInGuildTemplate = new String(resource.readAllBytes());
|
||||||
} catch (IOException | NullPointerException e) {
|
} catch (IOException | NullPointerException e) {
|
||||||
Main.LOGGER.warn("Failed to load template for guild not supported page", e);
|
Main.LOGGER.warn("Failed to load template for guild not supported page", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user