View Single Post
03/17/14, 06:11 AM   #10
Uesp
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 15
Don't you get a stack trace with the error? All the ones I've seen have a stack trace which gives the exact line the error occurred (at the top of the stack trace).

My usual mistakes when I cause this error are one of two things:
Code:
    val = GetMisSpeled()
The function name is simply misspelled, or:
Code:
     val = GetValue()
     Msg = "Value = " .. val
where the function returns nil and then the string concatentation fails. I've got in the habit of doing:
Code:
    Msg = "Value = ".. tostring(val)
for all strings to avoid this error (nil is turned into the "nil" string).

Another thing I've used successfully in some cases is the pcall() function.
  Reply With Quote