getText() return empty when iterating over getSelections()


I want simply get all selections and get the corresponding text.
What i simply do is:

let editor
    if (editor = atom.workspace.getActiveTextEditor()) {
      let selections = editor.getSelections()
      for(let i = 0; i < selections.length; i++) {
        let selection = selections[i].getText()
        .... SOME LOGIC....

If I select two strings I notice that in development console i get the first selection good and the second is an empty string.

If I remove all the logic below my console.log(selection) I get all the selections right.

Where i’m going wrong?