diff --git a/src/main/java/Discarpet/script/parsable/parsables/EmbedAuthorParsable.java b/src/main/java/Discarpet/script/parsable/parsables/EmbedAuthorParsable.java index d6831ccf..cdc504a4 100644 --- a/src/main/java/Discarpet/script/parsable/parsables/EmbedAuthorParsable.java +++ b/src/main/java/Discarpet/script/parsable/parsables/EmbedAuthorParsable.java @@ -30,11 +30,13 @@ public void apply(EmbedBuilder embedBuilder) { embedBuilder.setAuthor(name,url,image); return; } - String iconString = icon.getString(); - File file = new File(iconString); - if(file.exists()) { - embedBuilder.setAuthor(name, url, file); - return; + String iconString = icon == null? null : icon.getString(); + if(iconString != null) { + File file = new File(iconString); + if(file.exists()) { + embedBuilder.setAuthor(name, url, file); + return; + } } embedBuilder.setAuthor(name, url, iconString); } diff --git a/src/main/java/Discarpet/script/parsable/parsables/EmbedFooterParsable.java b/src/main/java/Discarpet/script/parsable/parsables/EmbedFooterParsable.java index 7e9eb1f9..0eb210c1 100644 --- a/src/main/java/Discarpet/script/parsable/parsables/EmbedFooterParsable.java +++ b/src/main/java/Discarpet/script/parsable/parsables/EmbedFooterParsable.java @@ -24,11 +24,13 @@ public void apply(EmbedBuilder embedBuilder) { embedBuilder.setFooter(text,image); return; } - String iconString = icon.getString(); - File file = new File(iconString); - if(file.exists()) { - embedBuilder.setFooter(text, file); - return; + String iconString = icon == null? null : icon.getString(); + if(iconString != null) { + File file = new File(iconString); + if (file.exists()) { + embedBuilder.setFooter(text, file); + return; + } } embedBuilder.setFooter(text, iconString); } diff --git a/src/main/java/Discarpet/script/parsable/parsables/WebhookMessageProfileParsable.java b/src/main/java/Discarpet/script/parsable/parsables/WebhookMessageProfileParsable.java index fbe39a13..b07825fc 100644 --- a/src/main/java/Discarpet/script/parsable/parsables/WebhookMessageProfileParsable.java +++ b/src/main/java/Discarpet/script/parsable/parsables/WebhookMessageProfileParsable.java @@ -18,10 +18,12 @@ public class WebhookMessageProfileParsable implements Applicable