Skip to content

Commit 20da475

Browse files
committed
empty support returns "", same for empty description
1 parent 74439f6 commit 20da475

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public String getDescription() throws ParsingException {
7676
try {
7777
desc = JsonUtils.getString(json, "description");
7878
} catch (ParsingException e) {
79-
return "No description";
79+
return "";
8080
}
8181
if (desc.length() == 250 && desc.substring(247).equals("...")) {
8282
//if description is shortened, get full description
@@ -256,7 +256,11 @@ public List<String> getTags(){
256256
@Nonnull
257257
@Override
258258
public String getSupportInfo() throws ParsingException {
259-
return JsonUtils.getString(json, "support");
259+
try {
260+
return JsonUtils.getString(json, "support");
261+
} catch (ParsingException e) {
262+
return "";
263+
}
260264
}
261265

262266
private String getRelatedStreamsUrl(List<String> tags) throws UnsupportedEncodingException {

extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeStreamExtractorDefaultTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void testGetLargeDescription() throws ParsingException {
6161
public void testGetEmptyDescription() throws Exception {
6262
PeertubeStreamExtractor extractorEmpty = (PeertubeStreamExtractor) PeerTube.getStreamExtractor("https://framatube.org/api/v1/videos/d5907aad-2252-4207-89ec-a4b687b9337d");
6363
extractorEmpty.fetchPage();
64-
assertEquals("No description", extractorEmpty.getDescription());
64+
assertEquals("", extractorEmpty.getDescription());
6565
}
6666

6767
@Test

0 commit comments

Comments
 (0)