tratando o nullpointerexception.