View Single Post
04-14-21, 02:28 PM   #13
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
The reason NONSENSE_EVENT fires an error has nothing to do with pcall, and everything to do with that not being a Blizzard event. I did say that only Blizzard events are supported.

It sounds like you are letting users enter a string, which could be anything, and attempting to register the string as an event, valid or not. Why would you do that? Putting in some validation code to check if the event is real would be an excellent idea.

You could use strfind or strmatch to parse _G and if the event is found, then register the event. That would prevent users from entering FLUFFS_ARE_CUTE, or at least reduce the list to the two events that have FLU*, both of which are valid.
  Reply With Quote