petermr / pygetpapers

a Python version of getpapers
Apache License 2.0
78 stars 9 forks source link

Unexpected None causes crash #13

Closed petermr closed 3 years ago

petermr commented 3 years ago
pygetpapers -q "thymol and cyprus" -x -o test1
INFO: Total Hits are 77
INFO: Total Hits are 77
WARNING: Could not find more papers
Traceback (most recent call last):
  File "/opt/anaconda3/bin/pygetpapers", line 8, in <module>
    sys.exit(main())
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 655, in main
    callpygetpapers.handlecli()
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 634, in handlecli
    self.apipaperdownload(args.query, args.limit,
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 452, in apipaperdownload
    self.makecsv(query_result, makecsv=makecsv, makehtml=makehtml)
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 59, in makecsv
    for paper_number, papers in enumerate(searchvariable):
TypeError: 'NoneType' object is not iterable
ayush4921 commented 3 years ago

Fixed in the latest commit.