Another option would be to simply make sure the name object exists before proceeding:
Code:
hooksecurefunc('ActionButton_Update', function(self)
local macroname = _G[self:GetName()..'Name']
if name and (not C['general'].buttons.showMacronames) then
macroname:SetAlpha(0)
end
end)
This would catch the ExtraActionButton, as well as any other (future) buttons Blizzard uses ActionButton_Update on that don't have name objects.