There is a safty toggle that hooks in to the hammer if the latch does not go all the way it does not move back off the hammer far enough to release it.
If you make a pratice of snapping the action close it will normally prevent this problem. I always raise my hammer to full cock and let it back down when I load my gun for hunting or replace the primer after pulling it up to the tree stand.