Fix NPE caused by getting name from testng test result