Browse Source

fix infinite loop when parsing empty nonnative subscription content (#3208)

Xiaokang Wang (Shelikhoo) 1 year ago
parent
commit
2415b89510
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/subscription/entries/nonnative/nonnative.go

+ 4 - 0
app/subscription/entries/nonnative/nonnative.go

@@ -30,6 +30,10 @@ func (a *AbstractNonNativeLink) fromBytes(bytes []byte) {
 }
 
 func (a *AbstractNonNativeLink) extractValue(content, prefix string) {
+	if content == "" {
+		return
+	}
+
 	{
 		// check if the content is a link
 		match, err := regexp.Match("[a-zA-Z0-9]+:((\\/\\/)|\\?)", []byte(content))