Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against null url in data_object ingest #1123

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions nmdc_server/ingest/data_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ def load(db: Session, cursor: Cursor, file_types: List[Dict[str, Any]]):
logger.warning(
f"Unknown url host '{url}', it need to be added to nginx config for bulk download"
)
if url.startswith("https://data.microbiomedata.org") and not url.startswith(
"https://data.microbiomedata.org/data"
if (
url
and url.startswith("https://data.microbiomedata.org")
and not url.startswith("https://data.microbiomedata.org/data")
):
obj["url"] = url.replace(
"https://data.microbiomedata.org", "https://data.microbiomedata.org/data"
Expand Down
Loading