← Back to team overview

openlp-core team mailing list archive

Re: [Merge] lp:~minkus/openlp/naturalsortsongs into lp:openlp

 

No worries.

This works in most instances, but I get a crash, and I think it's when get_natural_key is passed a blank string. I don't understand the relevant line of get_natural_key well enough to fix it - help please?

Traceback (most recent call last):
  File "C:\Users\chris\Documents\OpenLP\naturalsortsongs\openlp\plugins\songs\lib\mediaitem.py", line 213, in on_search_text_button_clicked
    self.display_results_book(search_results)
  File "C:\Users\chris\Documents\OpenLP\naturalsortsongs\openlp\plugins\songs\lib\mediaitem.py", line 307, in display_results_book
    search_results = sorted(search_results, key=lambda songbook_entry: (songbook_entry.songbook.name,
  File "C:\Users\chris\Documents\OpenLP\naturalsortsongs\openlp\plugins\songs\lib\mediaitem.py", line 308, in <lambda>
    get_natural_key(songbook_entry.entry)))
  File "C:\Users\chris\Documents\OpenLP\naturalsortsongs\openlp\core\utils\__init__.py", line 532, in get_natural_key
    if string[0].isdigit():
IndexError: string index out of range

-- 
https://code.launchpad.net/~minkus/openlp/naturalsortsongs/+merge/289566
Your team OpenLP Core is subscribed to branch lp:openlp.


References