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 @@ -988,10 +988,13 @@ public static String generateConsentCookie() {
988988 public static String extractCookieValue (final String cookieName ,
989989 @ Nonnull final Response response ) {
990990 final List <String > cookies = response .responseHeaders ().get ("set-cookie" );
991- int startIndex ;
992- String result = "" ;
991+ if (cookies == null ) {
992+ return EMPTY_STRING ;
993+ }
994+
995+ String result = EMPTY_STRING ;
993996 for (final String cookie : cookies ) {
994- startIndex = cookie .indexOf (cookieName );
997+ final int startIndex = cookie .indexOf (cookieName );
995998 if (startIndex != -1 ) {
996999 result = cookie .substring (startIndex + cookieName .length () + "=" .length (),
9971000 cookie .indexOf (";" , startIndex ));
You can’t perform that action at this time.
0 commit comments