Added nullcheck to .getText()