finalion / WordQuery

word fast-querying addon for anki
https://ankiweb.net/shared/info/775418273
GNU General Public License v3.0
291 stars 61 forks source link

Crash when "Query Selected" with only one item selected #12

Closed GarrisonBaird closed 7 years ago

GarrisonBaird commented 7 years ago

Add-on will crash with following message when click "Query Selected" in Browser if only one item is selected, everything will work well with more than one item selected.

Traceback (most recent call last):
  File "_path_to_base_folder_\addons\wquery\query.py", line 73, in query_from_menu
    query_from_editor()
  File "_path_to_base_folder_\addons\wquery\query.py", line 132, in query_from_editor
    q = query_single_fld(word, fld_index, maps)
  File "_path_to_base_folder_\addons\wquery\query.py", line 163, in query_single_fld
    assert fld_index > 0
AssertionError

Anki: latest (2.0.44) on Windows Add-on: master on gihub / install from ankiweb, tested on both, using local mdic

finalion commented 7 years ago

Thanks for your feedback. I have removed the assertion to support querying word not in the first field and please try the updates.