File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1085,10 +1085,13 @@ public static String generateConsentCookie() {
10851085 public static String extractCookieValue (final String cookieName ,
10861086 @ Nonnull final Response response ) {
10871087 final List <String > cookies = response .responseHeaders ().get ("set-cookie" );
1088- int startIndex ;
1089- String result = "" ;
1088+ if (cookies == null ) {
1089+ return EMPTY_STRING ;
1090+ }
1091+
1092+ String result = EMPTY_STRING ;
10901093 for (final String cookie : cookies ) {
1091- startIndex = cookie .indexOf (cookieName );
1094+ final int startIndex = cookie .indexOf (cookieName );
10921095 if (startIndex != -1 ) {
10931096 result = cookie .substring (startIndex + cookieName .length () + "=" .length (),
10941097 cookie .indexOf (";" , startIndex ));
You can’t perform that action at this time.
0 commit comments