Added the check from Boxer to make sure it doesn't crash when you don't have a document