Skip to content

Commit d9af927

Browse files
Daniel AMdenizkilic
andauthored
Issue-256: Updated the checkHeader to allow header_url in both video and image a… (#257)
* updated the checkHeader to allow header_url in both video and image as it is supported * added document format --------- Co-authored-by: denizkilic <[email protected]>
1 parent 61fc3f2 commit d9af927

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,9 @@ private void checkHeaderText() throws IllegalArgumentException {
166166
* @throws IllegalArgumentException Occurs when type is not {@code HEADER} and format is not {@code IMAGE}.
167167
*/
168168
private void checkHeaderUrl() throws IllegalArgumentException {
169-
if (!(type.equals(HSMComponentType.HEADER)
170-
&& format.equals(HSMComponentFormat.IMAGE))
171-
) {
172-
throw new IllegalArgumentException("\"header_url\" is available for only HEADER type and IMAGE format.");
169+
if (!(type.equals(HSMComponentType.HEADER) &&
170+
(format.equals(HSMComponentFormat.IMAGE) || format.equals(HSMComponentFormat.VIDEO) || format.equals(HSMComponentFormat.DOCUMENT)))) {
171+
throw new IllegalArgumentException("\"header_url\" is available for only HEADER type and IMAGE, VIDEO and DOCUMENT format.");
173172
}
174173
}
175174
}

0 commit comments

Comments
 (0)