Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006647 [JEDI Code Library] JclCompression minor sometimes 2018-08-13 15:56 2018-08-13 15:56
Reporter nojoy View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version Version 2.5 (Subversion repository/Daily zips)
Summary 0006647: Archive.CurrentItemIndex may return 0 in DoProgress when Archive.ItemCount is zero
Description I do not exactly know under which circumstances, but sometimes (archive with many files?) TJclSevenzipUpdateArchive.OpenArchive triggers OpenCallback.DoProgress.

If this happens the function TJclSevenzipUpdateArchive.ListFiles fails (/can fail?) with an EListError, if the OnProgress-Callback contains the following code:

    if Archive.CurrentItemIndex >= 0 then
        Assert(Archive.ItemCount > 0); // this fails
        Item := Archive.Items[Archive.CurrentItemIndex]; //this gives an error

I expect CurrentItemIndex to be -1 if ItemCount is zero.

To fix this `FCurrentItemIndex := -1;` should be added to TJclCompressionArchive.ClearItems;
Additional Information
Tags No tags attached.
Fixed in revision
IDE version All
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-08-13 15:56 nojoy New Issue
2018-08-13 15:56 nojoy IDE version => All

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker