fix potential out of bounds on empty list
Please have a careful look at my changes. My Qt foo is rather out-dated and the code in question goes a bit over my head.
Also, would you know off the top or your hat where to test this? Is this the sync feature (Sync -> Open file for sync/merge)?
Edited by Frederik Schwarzer