That's good advice, but I'm seeing things in the news about "flash mobs" etc. Hard to know in advance where not to be.
Experience/wisdom from the Wash. D.C. riots of 1968:
If you are caught in the riot, then you can only try to get away, or shelter in a safe place. If you walk away, try not to draw attention to yourself. If noticed, try to say/do something that shows you are "with" the rioters, but keep it legal - - shout something, give the right cheer/sign/gesture etc., but just keep going. Mostly, the rioters will be too interested in other things than you, as long as they have no reason to suspect you are one of the "bad" guys.
The other alternative is to shelter in place, assuming it is a safe place. Riots usually last a matter of hours, so sometimes patience and sitting in one place is a survival skill. Of course, not if the building is on fire. . .
Bottom line, get away and stay away from the "action." Do not let your curiosity lead you into trying to see what is happening.
_________________________
"Better is the enemy of good enough."