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.