Fix NPE in getComponentByText