koniu / recoll-webui

web interface for recoll desktop search
275 stars 55 forks source link

Fixed bug when there are less entries than the maximum number of resu… #76

Closed alberti42 closed 3 years ago

alberti42 commented 5 years ago

Without this bugfix I was continuously getting an error every time that the number of entries found was less then the maximum number of entries displayed. This is the error I was getting on Ubuntu 16.04.5 LTS:

127.0.0.1 - - [26/Jun/2019 14:35:26] "GET /results?query=dichroitisc*&dir=shared%2Fprojects%2FDQSIM&after=&before=&sort=relevancyrating&ascending=0&page=1 HTTP/1.1" 500 1768 :3:common/rclinit.cpp:341::Recoll 1.25.19 + Xapian 1.2.22 [/home/recoll/.recoll] Traceback (most recent call last): File "/var/www/recoll-webui-master/bottle.py", line 744, in _handle return route.call(**args) File "/var/www/recoll-webui-master/bottle.py", line 1479, in wrapper rv = callback(*a, **ka) File "/var/www/recoll-webui-master/bottle.py", line 2850, in wrapper result = func(*args, **kwargs) File "/var/www/recoll-webui-master/webui.py", line 252, in results res, nres, timer = recoll_search(query) File "/var/www/recoll-webui-master/webui.py", line 216, in recoll_search v = getattr(doc, f) AttributeError: 'NoneType' object has no attribute 'ipath'

The fix is very simple, since it stops the for loop once there are no more entries found.

ghost commented 5 years ago

Hi,

This was already fixed in the repository where I do maintenance for recoll-webui while koniu is not around:

https://opensourceprojects.eu/p/recollwebui/code/