Add check that metric is not nil in report

Small code refactoring