Skip to content

Commit 0537f04

Browse files
Refactor Description constructor
1 parent 4c183af commit 0537f04

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/stream/Description.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ public class Description implements Serializable {
1717

1818
public Description(@Nullable final String content, final int type) {
1919
this.type = type;
20-
if (content == null) {
21-
this.content = "";
22-
} else {
23-
this.content = content;
24-
}
20+
this.content = Objects.requireNonNullElse(content, "");
2521
}
2622

2723
public String getContent() {

0 commit comments

Comments
 (0)