Cannot read property 'find' of undefined?

I think it’s a bug. Don’t really know how to describe. You can run this script and it mostly will give you Cannot read property 'find' of undefined? @admin Thanks.
RPA version 5.9.5. Chrome 87

    {
      "Command": "store",
      "Target": "MY2",
      "Value": "market"
    },
    {
      "Command": "if_v2",
      "Target": "${market} == \"MY1\"",
      "Value": ""
    },
    {
      "Command": "if_v2",
      "Target": "${market} == \"MY2\"",
      "Value": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "if_v2",
      "Target": "${market} == \"MY1\"",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "11",
      "Value": ""
    },
    {
      "Command": "elseif",
      "Target": "${market} == \"MY2\"",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "11",
      "Value": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "11",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }

Why you open multiple if before end command ?

Use one if, and close it, and open anothe if and working like a charm.

     {
      "Command": "if_v2",
      "Target": "${market} == \"MY1\"",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },

Your macro seems with more errors and command not closed.

Read this post you can use multiple condition in if to have a short and fast code, have not sense your long code

Hi, I think it is bug, too! => Thanks for reporting it, I created a ticket (#788) for it. Nested IF are supported and should not return such an error.

Meanwhile, of course, you can use the workaround from @newuserkantu

Thanks. I thought about it before, but I might have did it wrong. I’ll take another look at it.

Sure, thanks. I’ll use another way to get the same effect.