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 2019-04-17 07:22
Reporter nojoy View Status public  
Assigned To jfudickar
Priority normal Resolution fixed  
Status resolved   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
    begin
        Assert(Archive.ItemCount > 0); // this fails
        Item := Archive.Items[Archive.CurrentItemIndex]; //this gives an error
    end;

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

-  Notes
(0021661)
mh (reporter)
2019-04-13 10:02

I created a pull request containing your suggested initialization of the Field in the ClearItems method: https://github.com/project-jedi/jcl/pull/47 [^]
(0021711)
mh (reporter)
2019-04-16 22:01

This pull request has been merged in, so this issue can be closed.
(0021714)
jfudickar (developer)
2019-04-17 07:22

Fixed

- Issue History
Date Modified Username Field Change
2018-08-13 15:56 nojoy New Issue
2018-08-13 15:56 nojoy IDE version => All
2019-04-13 10:02 mh Note Added: 0021661
2019-04-16 22:01 mh Note Added: 0021711
2019-04-17 07:22 jfudickar Note Added: 0021714
2019-04-17 07:22 jfudickar Status new => resolved
2019-04-17 07:22 jfudickar Resolution open => fixed
2019-04-17 07:22 jfudickar Assigned To => jfudickar


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