Merge pull request #232 from DevFactory/release/null-pointer-should-not-be-dereferenced-fix-1
Code quality fix - Null pointers should not be dereferenced.
This commit is contained in:
commit
c6ccc2b20d
|
@ -40,7 +40,7 @@ public class AudioStream {
|
||||||
|
|
||||||
// revelas wether two streams are equal
|
// revelas wether two streams are equal
|
||||||
public boolean equals(AudioStream cmp) {
|
public boolean equals(AudioStream cmp) {
|
||||||
return equalStats(cmp)
|
return cmp != null && equalStats(cmp)
|
||||||
&& url == cmp.url;
|
&& url == cmp.url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class VideoStream {
|
||||||
|
|
||||||
// revelas wether two streams are equal
|
// revelas wether two streams are equal
|
||||||
public boolean equals(VideoStream cmp) {
|
public boolean equals(VideoStream cmp) {
|
||||||
return equalStats(cmp)
|
return cmp != null && equalStats(cmp)
|
||||||
&& url == cmp.url;
|
&& url == cmp.url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -599,7 +599,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
public String getAverageRating() throws ParsingException {
|
public String getAverageRating() throws ParsingException {
|
||||||
try {
|
try {
|
||||||
if (playerArgs == null) {
|
if (playerArgs == null) {
|
||||||
videoInfoPage.get("avg_rating");
|
return videoInfoPage.get("avg_rating");
|
||||||
}
|
}
|
||||||
return playerArgs.getString("avg_rating");
|
return playerArgs.getString("avg_rating");
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
|
Loading…
Reference in New Issue