[Fixes bug #1191233] Add a null check in the text tool.