Error in Data Extraction from '.txt' file

Hello, good evening.
I’m having problems while trying to extract specific data from a “.txt” file.

I’ll try to explain it really carefully because UiPath Forum does not allow me to upload any type of files to my post.
What I did was:

‘For Each’ item in my file, separated by a specific character, I did:

  • IF validations where I ask if the first word is equal to “SOMETHING”

  • If the first word is indeed equal to “SOMETHING”, I execute a ‘Message Box’ where I can see the item.

  • If the first word is not equal to “SOMETHING”, I execute a ‘Message Box’ saying “NULL”.

The problem occurs when, during the bot execution, I get several 'Message Box’es with both values of “item” and “NULL”. Which means that my logic is actually working.
But somehow, bot execution crashes in a specific point where there is literally nothing different in the ‘.txt’ file.
It seems to me this does not make any sense because:

  1. I got several 'Message box’es which are proof that my execution worked for a piece of the file.
  2. There is literally nothing different in the file, it is just more STRING items. From a item to another, it didn’t change formats, it didn’t change at all,

If someone can understand this and explain to me why is this crashing, I will be so grateful.
Thank you!!