Fix check for non-empty strings

Fixes: https://bugzilla.gnome.org/727957