diff --git a/feedleware/openalex/openalex.py b/feedleware/openalex/openalex.py index 447bd6a..b8e3726 100644 --- a/feedleware/openalex/openalex.py +++ b/feedleware/openalex/openalex.py @@ -141,7 +141,10 @@ class APIClient: sorted(abstract_forward.items()), )) - if work["primary_location"]["source"] is not None: + if ( + work["primary_location"] is not None + and work["primary_location"]["source"] is not None + ): source = work["primary_location"]["source"]["display_name"] results.append({