avoid NullPointerException in name function of MetricRegistry class

avoid NullPointerException when second argument to name function of MetricRegistry class is null and only two arguments are provided