Make sure to check that a summary exists before using it

Failing to check for this caused errors when write_summary was set to false.
Merge pull request #128 from porterjamesj/patch-1

Make sure to check that a summary exists before using it