Skip to content

Commit

Permalink
fix fatal search error when manifest is malformed (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
MobiusCraftFlip authored Jun 11, 2023
1 parent 4258858 commit 8fe6b7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wally-registry-backend/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ impl SearchBackend {
for (_score, doc_address) in top_docs {
let retrieved_doc = searcher.doc(doc_address)?;
let retrieved_doc = self.schema.to_json(&retrieved_doc);
let retrieved_doc: NativeDocResult = serde_json::from_str(&retrieved_doc)?;

let retrieved_doc: NativeDocResult = match serde_json::from_str(&retrieved_doc) {
Ok(doc) => doc,
Err(_) => continue,
};
docs.push(DocResult {
scope: retrieved_doc.scope[0].clone(),
name: retrieved_doc.name[0].clone(),
Expand Down

0 comments on commit 8fe6b7c

Please sign in to comment.