Skip to content

Commit f66c20d

Browse files
mauriciocolliTobiGr
authored andcommitted
Ignore null-keyed entries when iterating through the response headers
1 parent 5edd774 commit f66c20d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • extractor/src/main/java/org/schabi/newpipe/extractor/downloader

extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Response.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public String latestUrl() {
6868
@Nullable
6969
public String getHeader(String name) {
7070
for (Map.Entry<String, List<String>> headerEntry : responseHeaders.entrySet()) {
71-
if (headerEntry.getKey().equalsIgnoreCase(name)) {
71+
final String key = headerEntry.getKey();
72+
if (key != null && key.equalsIgnoreCase(name)) {
7273
if (headerEntry.getValue().size() > 0) {
7374
return headerEntry.getValue().get(0);
7475
}

0 commit comments

Comments
 (0)