Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

Commit 75564dd

Browse files
committed
Add check for regex match
1 parent cc80466 commit 75564dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

YoutubeExtractor/YoutubeExtractor/Decipherer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private static string FindMatch(string text, string regexp)
122122
Regex rgx = new Regex(regexp);
123123
var matches = rgx.Matches(text);
124124

125-
return matches[0].Groups[1].Value;
125+
return matches.Count > 0 ? matches[0].Groups[1].Value : string.Empty;
126126
}
127127
}
128128
}

0 commit comments

Comments
 (0)