Sfoglia il codice sorgente

fix: completion error when dataset was deleted (#819)

takatost 1 anno fa
parent
commit
2f179d61dc
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      api/core/orchestrator_rule_parser.py

+ 3 - 0
api/core/orchestrator_rule_parser.py

@@ -188,6 +188,9 @@ class OrchestratorRuleParser:
             Dataset.id == tool_config.get("id")
         ).first()
 
+        if not dataset:
+            return None
+
         if dataset and dataset.available_document_count == 0 and dataset.available_document_count == 0:
             return None