Skip to content

Commit

Permalink
Fix lister assert when re-selecting file.
Browse files Browse the repository at this point in the history
SWUpdateGUI crashes, when:
1. selection is made in file-selection-window;
2. window is closed using "Cancel" button;
3. file-selection window is opened again;
4. the same file is selected.

The crash is due to assertion fail in lister widget's onSelectLine handler.
Whenever file list widget is repopulated, the selection state is not cleared,
which causes assert to fail.

This fix changes the way file list is repopulated to clear selection state and avoid
error.

Signed-off-by: Andrzej Szczepański <[email protected]>
  • Loading branch information
Andrzej Szczepański authored and sbabic committed Apr 29, 2020
1 parent 79ce899 commit a52b3d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SWUpdateGUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ function FileboxWindow:scanmedia()
end
self.filelist = files
local list = self:getById("files-list")
list:clear()
list:setList(List:new())
for i=1,#files do
local entry = {}
table.insert(entry, GetFileName(files[i]))
Expand Down

0 comments on commit a52b3d3

Please sign in to comment.