Check if item is in session before expunging

This change makes the code not throw an error when handling an item that has not yet been added to a session. I ran into this problem while writing tests for another project, but I'm not quite sure how to reproduce the issue yet, so I couldn't include a test for this.