Skip to content

Commit

Permalink
Fix null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
islean committed Jan 21, 2025
1 parent 4860123 commit ae7ff23
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cg/services/orders/validation/rules/case_sample/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
)
from cg.services.orders.validation.workflows.balsamic.models.sample import BalsamicSample
from cg.services.orders.validation.workflows.balsamic_umi.models.sample import BalsamicUmiSample
from cg.store.models import Application
from cg.store.models import Case as DbCase
from cg.store.models import Customer
from cg.store.models import Application, Customer
from cg.store.models import Sample as DbSample
from cg.store.store import Store

Expand Down Expand Up @@ -314,6 +312,6 @@ def is_sample_not_from_collaboration(
def get_existing_case_names(order: OrderWithCases, status_db: Store) -> set[str]:
existing_case_names: set[str] = set()
for _, case in order.enumerated_existing_cases:
db_case: DbCase | None = status_db.get_case_by_internal_id(case.internal_id)
existing_case_names.add(db_case.name)
if db_case := status_db.get_case_by_internal_id(case.internal_id):
existing_case_names.add(db_case.name)
return existing_case_names

0 comments on commit ae7ff23

Please sign in to comment.