IDE-1667 null check for text regions