WeakAuras

91 - WA hooks chat box - and throws errors on macro

I was trying to debug a custom animation and wanted to test something with the following macro:

/script local _, _, _, _, _, _, expirationTime = UnitAura("player", "Inquisition"); DEFAULT_CHAT_FRAME:AddMessage(expirationTime)

What steps will reproduce the problem?
1. click said macro
2. nothing happens

What version of the product are you using?
r75

Do you have an error log of what happened?
1x WeakAuras-1.3b3 r75\Transmission.lua:208: attempt to index local 'remaining' (a nil value)
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
(tail call): ?:
<string>:"local _, _, _, _, _, _, expirationTime = Un...":1: in main chunk
...:
Interface\FrameXML\ChatFrame.lua:3737: in function `ChatEdit_SendText':
Interface\FrameXML\ChatFrame.lua:2536: in function <Interface\FrameXML\ChatFrame.lua:2529>:
<in C code>: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:274: in function `handler':
Interface\FrameXML\SecureTemplates.lua:541: in function <Interface\FrameXML\SecureTemplates.lua:489>:
<in C code>: ?
Interface\FrameXML\SecureHandlers.lua:264: in function <Interface\FrameXML\SecureHandlers.lua:261>:
<in C code>: ?
Interface\FrameXML\SecureHandlers.lua:294: in function <Interface\FrameXML\SecureHandlers.lua:277>:
(tail call): ?:

Locals:
(*temporary) = "LeftButton"
(*temporary) = false
(*temporary) = <function> defined =[C]:-1

-

Please provide any additional information below.

User When Change
Mirrormn Jan 28, 2011 at 20:36 UTC Changed status from New to Fixed
Ravengus Jan 28, 2011 at 18:20 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of Ravengus Ravengus Jan 28, 2011 at 20:41 UTC - 0 likes

    Thanks... I will definitly do that in the future! :)

  • Avatar of Mirrormn Mirrormn Jan 28, 2011 at 20:35 UTC - 0 likes

    Actually, this usage of ChatFrame:AddMessage() would have created an error without WeakAuras; you tried to pass a nil value as the first argument, and ChatFrame doesn't like that. However, I can (and did) add a small check that makes the error message more relevant (i.e., it gives ChatFrame's error message instead of WeakAuras') when this occurs.

    In the future, I would recommend using print() instead of DEFAULT_CHAT_FRAME:AddMessage - it is a built-in function that allows you to use multiple arguments which are concatenated for you, will correctly convert nils, tables, booleans, etc. to strings, and is much easier to type.

    Fixed in r76.

  • 2 comments

Facts

Last updated
Jan 28, 2011
Reported
Jan 28, 2011
Status
Fixed - Developer made requested changes. QA should verify.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees