Thread Tools Display Modes
04-16-10, 06:15 AM   #1
magilla73
A Murloc Raider
Join Date: Apr 2010
Posts: 7
lua error

Not sure if this has been reported...kind of hard to seach since I'm not sure what the error is tied to, only that swatter pops it on my screen from time to time
Date: 2010-04-16 07:10:24
ID: 2
Error occured in: Global
Count: 1
Message: ..\AddOns\nUI\Units\nUI_UnitLabel.lua line 321:
bad argument #1 to 'format' (string expected, got nil)
Debug:
(tail call): ?
[C]: ?
[C]: format()
nUI\Units\nUI_UnitLabel.lua:321: updateLabelInfo()
nUI\Units\nUI_UnitLabel.lua:192:
nUI\Units\nUI_UnitLabel.lua:174
 
04-16-10, 07:18 AM   #2
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Off the top of my head, my only guess would be that this is happening when getting a "nil" name for a unit. Is there any pattern to when it occurs? In battlegrounds, raids, solo questing... etc?

I'm at work and don't have access to my code base at the moment, so I'll look at it when I get home this evening.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
04-16-10, 08:14 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Well this seems to be the calling block, so perhaps somewhere along the lines the unit_id resolves to a unit that doesn't have a name for some reason or the unit_id nils out :

Code:
local function onQueueUpdate( who, elapsed )

	queue_timer = queue_timer - elapsed;
	
	if queue_timer <= 0 then -- process the update queue at the user selected frame rate
	
		queue_timer = nUI_Unit.frame_rate;

		for unit_id in pairs( UpdateQueue ) do
		
			if UpdateQueue[unit_id] then
			
				UpdateQueue[unit_id] = false;
				unit_info = NewUnitInfo[unit_id];
								
				if LabelCallbacks[unit_id] and #LabelCallbacks[unit_id] > 0 then
					nUI_Unit:notifyCallbacks( 
						nUI_L["unit label"], LabelCallbacks, LabelUnits, 
						unit_info, unit_id, nUI_Unit:updateLabelInfo( unit_id, unit_info ) 
					);
				end
			end
		end
	end	
end
__________________

Last edited by Xrystal : 04-16-10 at 08:17 AM.
 
04-16-10, 09:04 AM   #4
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
I'm going to guess though that the actual error is being thrown either in the UpdateLabelInfo() method or in the actual display update.

yes?

Which method is line 321 in?
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
04-16-10, 10:53 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Yes, that is indeed the line that errors out .. either unit_id is bad or name is bad.

Code:
function nUI_Unit:updateLabelInfo( unit_id, unit_info )

--	nUI_ProfileStart( ProfileCounter, "updateLabelInfo" );
	
	modified  = false;
	
	if unit_info then
		
		-- check to see if the label has changed
		
		name, realm = UnitName( unit_id );

		if unit_info.status_info and unit_info.status_info.is_dnd then
			name = ("%s |cFF00FFFF(%s)|r"):format( name, nUI_L["DND"] );		end
		
		if unit_info.name ~= name
		or unit_info.realm ~= realm
		then
			
			modified              = true;
			unit_info.last_change = GetTime();
			unit_info.name        = name;
			unit_info.realm       = realm;
			
		end
	end
	
--	nUI_ProfileStop();
	
	return modified and unit_info or nil;
	
end
__________________
 
04-16-10, 11:04 AM   #6
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
The name is bad... the unit is being reported as either AFK or DND but we don't have the unit's name yet. Probably in a random dungeon or battleground would be my guess.

It'll be an easy fix.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
04-16-10, 07:37 PM   #7
magilla73
A Murloc Raider
Join Date: Apr 2010
Posts: 7
It has been popping up during battlegrounds, usually just as I enter combat if that helps
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Support » nUI: Bug Reports » lua error

Thread Tools
Display Modes

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