diff --git a/slack-base/src/main/java/com/hubspot/slack/client/models/blocks/SectionIF.java b/slack-base/src/main/java/com/hubspot/slack/client/models/blocks/SectionIF.java index 364202e3..2350bf49 100644 --- a/slack-base/src/main/java/com/hubspot/slack/client/models/blocks/SectionIF.java +++ b/slack-base/src/main/java/com/hubspot/slack/client/models/blocks/SectionIF.java @@ -47,7 +47,9 @@ default void check() { hasNonEmptyTextField || hasFields, "Must include text if not providing a list of fields" ); - boolean isTextLengthValid = getText().getText().length() <= 3000; - Preconditions.checkState(isTextLengthValid, "The text length of a Section block cannot exceed 3000 characters"); + if (hasNonEmptyTextField) { + boolean isTextLengthValid = getText().getText().length() <= 3000; + Preconditions.checkState(isTextLengthValid, "The text length of a Section block cannot exceed 3000 characters"); + } } }