wxWidgets assertion when running backup
Brought to you by:
alttoucan
Problem description
WHen starting backup, after entering the password Toucan presents the error messagebox with the following message:
Title: wxWidgets Debug Alert
Contents:
../../src/common/arrstr.cpp(369): assert "nIndex < m_nCount" failed in
RemoveAt(): bad index in wxArrayString::Remove [in thread 1b54]
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings
The assert seems to be harmless, after clicking "No" or "Cancel" Backup continues just fine.
Expected result
Backup process continues without an error
Actual result
Assertion alert is displayed
After further investigation this turned out to be a wxWidgets bug. Toucan calls wxFileName::RemoveLastDir at certain point and in the wxWidgets code there's no check if there are actually no dirs at all in the path. Luckily there's an assert in RemoveAt which is triggered in this case - that helped to find the root cause.
As such, the only thing that matters for triggering the error is adding a whole drive (like e.g. "F:\" representing the thumb drive) to the backup selection. Passwords or whether it's the only item in the list or not, etc are irrelevant.
fixed with [toucan:51ed54]
Related
Commit: [51ed54]