Fixed a bug regarding report generation

Empty reports caused a crash.