Skip to content

Commit

Permalink
Merge pull request #476 from rachmadaniHaryono/bugfix/bukuserver-page
Browse files Browse the repository at this point in the history
fix: dev: index error on bookmark
  • Loading branch information
jarun committed Oct 16, 2020
2 parents f97583a + b507000 commit 35aa009
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bukuserver/views.py
Expand Up @@ -219,7 +219,10 @@ def get_list(self, page, sort_field, sort_desc, search, filters, page_size=None)
bookmarks = sorted(bookmarks, key=lambda x: x[key_idx], reverse=sort_desc)
count = len(bookmarks)
if page_size and bookmarks:
bookmarks = list(chunks(bookmarks, page_size))[page]
try:
bookmarks = list(chunks(bookmarks, page_size))[page]
except IndexError:
bookmarks = []
data = []
for bookmark in bookmarks:
bm_sns = SimpleNamespace(id=None, url=None, title=None, tags=None, description=None)
Expand Down

0 comments on commit 35aa009

Please sign in to comment.