We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69e18c8 commit dd8687fCopy full SHA for dd8687f
1 file changed
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java
@@ -988,10 +988,13 @@ public static String generateConsentCookie() {
988
public static String extractCookieValue(final String cookieName,
989
@Nonnull final Response response) {
990
final List<String> cookies = response.responseHeaders().get("set-cookie");
991
- int startIndex;
992
- String result = "";
+ if (cookies == null) {
+ return EMPTY_STRING;
993
+ }
994
+
995
+ String result = EMPTY_STRING;
996
for (final String cookie : cookies) {
- startIndex = cookie.indexOf(cookieName);
997
+ final int startIndex = cookie.indexOf(cookieName);
998
if (startIndex != -1) {
999
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
1000
cookie.indexOf(";", startIndex));
0 commit comments