Thread Tools Display Modes
11-04-11, 11:50 AM   #1
Safturento
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 13
Errors using oUF for raids

I'm currently working on an oUF layout, and am getting a lua error upon entering a raid or battleground. Most of the time the error looks like this:
Code:
1x table: 27A45838
nil

Locals:
nil
But if I don't reload my UI for a while and continue doing BGs, I'll eventually get an error saying that 'unit' is nil (unit being the second parameter of my layout function). A few of my raid frames also fail to show up. They spawn, because the ones that do show up are anchored to them properly, but it's as if it's not setting the layout for them. Does anyone know what would cause this, and how to fix it?

edit: I'm using oUF version 1.5.15

edit2: Here's my layout file

Last edited by Safturento : 11-04-11 at 12:21 PM.
  Reply With Quote
11-04-11, 01:51 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
How does the default Lua error frame display the error?
__________________
「貴方は1人じゃないよ」
  Reply With Quote
11-04-11, 02:59 PM   #3
Safturento
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 13
Code:
Message: Interface\AddOns\stUnitFrames\layout.lua:12: attempt to concatenate local 'unit' (a nil value)
Time: 11/04/10 15:55:49
Count: 17
Stack: [C]: ?
[C]: ?
Interface\FrameXML\RestrictedFrames.lua:604: in function <Interface\FrameXML\RestrictedFrames.lua:603>
Interface\FrameXML\RestrictedFrames.lua:742: in function `CallMethod'
[string "		local header = self:GetParent()..."]:52: in function <[string "		local header = self:GetParent()..."]:1>
(tail call): ?
[C]: ?
Interface\FrameXML\RestrictedExecution.lua:441: in function <Interface\FrameXML\RestrictedExecution.lua:412>
Interface\FrameXML\SecureGroupHeaders.lua:108: in function `SetupUnitButtonConfiguration'
Interface\FrameXML\SecureGroupHeaders.lua:158: in function <Interface\FrameXML\SecureGroupHeaders.lua:115>
Interface\FrameXML\SecureGroupHeaders.lua:457: in function <Interface\FrameXML\SecureGroupHeaders.lua:381>
[C]: in function `Show'
Interface\FrameXML\SecureStateDriver.lua:100: in function <Interface\FrameXML\SecureStateDriver.lua:95>
Interface\FrameXML\SecureStateDriver.lua:127: in function <Interface\FrameXML\SecureStateDriver.lua:119>
Line 12:
Code:
if not self or not unit then print("self: "..self..";  unit"..unit) return end
Whenever I remove that line, I get this error:
Code:
Message: Interface\AddOns\stUnitFrames\layout.lua:12: Wrong object type for member function
Time: 11/04/10 16:00:59
Count: 1
Stack: [C]: ?
[C]: ?
Interface\FrameXML\RestrictedFrames.lua:604: in function <Interface\FrameXML\RestrictedFrames.lua:603>
Interface\FrameXML\RestrictedFrames.lua:742: in function `CallMethod'
[string "		local header = self:GetParent()..."]:52: in function <[string "		local header = self:GetParent()..."]:1>
(tail call): ?
[C]: ?
Interface\FrameXML\RestrictedExecution.lua:441: in function <Interface\FrameXML\RestrictedExecution.lua:412>
Interface\FrameXML\SecureGroupHeaders.lua:108: in function `SetupUnitButtonConfiguration'
Interface\FrameXML\SecureGroupHeaders.lua:158: in function <Interface\FrameXML\SecureGroupHeaders.lua:115>
Interface\FrameXML\SecureGroupHeaders.lua:392: in function <Interface\FrameXML\SecureGroupHeaders.lua:381>
[C]: in function `Show'
Interface\FrameXML\SecureStateDriver.lua:100: in function <Interface\FrameXML\SecureStateDriver.lua:95>
Interface\FrameXML\SecureStateDriver.lua:127: in function <Interface\FrameXML\SecureStateDriver.lua:119>
Line 12 in that error being
Code:
self:RegisterForClicks("AnyUp")
From what I can see, it looks as if the header is trying to set the layout for a frame, but is only giving it the frame, and not the unit.

edit: Also, when I run a script to print GetObjectType of one of the frames that bugged out, it does show the object type as a Button, just like the frames that do work.

Last edited by Safturento : 11-04-11 at 03:06 PM.
  Reply With Quote
11-04-11, 03:07 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The unit variable isn't always set on headers. oUF only does it when it is able to figure out what the layout is trying to spawn.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
11-04-11, 03:14 PM   #5
Safturento
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 13
Originally Posted by haste View Post
The unit variable isn't always set on headers. oUF only does it when it is able to figure out what the layout is trying to spawn.
I guess adding
Code:
	self:SetActiveStyle("stUnitFrames")
fixes that then. :P Thank you. Just another quick question, I'm assuming that there's no built in function with oUF to kill the blizzard raid frames?
  Reply With Quote
11-04-11, 03:18 PM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
That's correct. I don't really replace the raid manager part of the UI, so I don't remove it. Earlier there weren't even slash commands for some of the functionality -- that might have changed now however...
__________________
「貴方は1人じゃないよ」
  Reply With Quote
11-04-11, 03:44 PM   #7
Safturento
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 13
Originally Posted by haste View Post
That's correct. I don't really replace the raid manager part of the UI, so I don't remove it. Earlier there weren't even slash commands for some of the functionality -- that might have changed now however...
Oh okay, makes sense. Thanks again for the help.
  Reply With Quote
11-09-11, 09:43 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
Message: Interface\AddOns\stUnitFrames\layout.lua:12: attempt to concatenate local 'unit' (a nil value)
Code:
if not self or not unit then print("self: "..self..";  unit"..unit) return end
Since you explicitly check whether unit is nil/false before calling print, it seems fairly obvious that you're going to get string concatenation errors. If you want a debug print for nil units, wrap unit in a tostring() call. Also, print does not require manual concatention. You can just pass it multiple values, and it will automatically join them with spaces between. Finally, you will get a (mostly theoretical) speed boost by switching the return/print order.

Code:
if not self or not unit then
     return print("self:", self, "; unit:", tostring(unit))
end
If the unit is nil you will see "self: something ; unit: nil".

Also, depending on how you're using this information, you might want to print self:GetName() instead of just self.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Errors using oUF for raids


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off