Avoid NullPointerException when querying for non-existent metric