Fix bug where incorrect error message was being printed when
a metric value of None was received.