colonelwatch commited on
Commit
628360c
1 Parent(s): 1d3a47f

Cover no author name edge case

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -95,7 +95,8 @@ def format_response(neighbors, response):
95
  if len(abstract) > 2000:
96
  abstract = abstract[:2000] + '...'
97
 
98
- # authors: truncate to 3 authors if necessary
 
99
  if len(author_names) >= 3:
100
  authors_str = ', '.join(author_names[:3]) + ', ...'
101
  else:
 
95
  if len(abstract) > 2000:
96
  abstract = abstract[:2000] + '...'
97
 
98
+ # authors: cover no name edge case, truncate to 3 authors if necessary
99
+ author_names = [author_name if author_name else 'No name' for author_name in author_names]
100
  if len(author_names) >= 3:
101
  authors_str = ', '.join(author_names[:3]) + ', ...'
102
  else: