patches to prev commit - handling empty text

Signed-off-by: nat94 <natka-j-94@o2.pl>