Fix empty dialog caption check.

Replaced `==""` with `.length()` earlier this year without thinking. Corrects it to use `.empty()`.