Skip to content

Commit 0039a6f

Browse files
committed
Add handling for empty processor_runs_objref
1 parent 754bb6d commit 0039a6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llmstack/processors/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,16 @@ def create_processor_runs_objref(self, processor_runs=[]):
382382
return processor_runs_objrefs.objref
383383

384384
def get_processor_runs_from_objref(self):
385+
if not self.processor_runs_objref:
386+
return []
385387
file_asset = get_asset_by_objref_internal(self.processor_runs_objref)
386388
content = file_asset.file.read().decode("utf-8")
387389
return json.loads(content).get("processor_runs", [])
388390

389391
@classmethod
390392
def get_processor_runs(cls, processor_runs_objref):
393+
if not processor_runs_objref:
394+
return []
391395
file_asset = get_asset_by_objref_internal(processor_runs_objref)
392396
content = file_asset.file.read().decode("utf-8")
393397
return json.loads(content).get("processor_runs", [])

0 commit comments

Comments
 (0)