Added basic error handling for no-text situations.

Prevents crashing when you can't getText() on a pane.