Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSTFolder::getNextChild exceptions leave PSTFolder in unadvanceable state #79

Open
matthewjosephtaylor opened this issue May 9, 2019 · 0 comments

Comments

@matthewjosephtaylor
Copy link

If PSTFolder has an error in getNextChild it leaves PSTFolder object in a state where it can never advance to the next child.

Example of exception that leaves PSTFolder in a bad state:

Exception com.pff.PSTException: Unable to find 2098852 is desc: true
      at PSTFile.findBtreeItem (PSTFile.java:756)
      at PSTFile.getDescriptorIndexNode (PSTFile.java:773)
      at PSTFolder.getNextChild (PSTFolder.java:295)

Believe this could be overcome by incrementing this.currentEmailIndex ahead of doing the work of creating the child object.

Might also be better to give users a simple API to get children at a specific index.

My present work-around is to attempt to use the PstFolder::moveChildCursorTo method to advance manually, and keep track fo the current index outside of PSTFolder. (still testing code not 100% on if this strategy works as expected).

@matthewjosephtaylor matthewjosephtaylor changed the title PSTFolder::getNextChild exceptions leave PSTFolder in advanceable state PSTFolder::getNextChild exceptions leave PSTFolder in unadvanceable state May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant