Hi! atm im trying to add some context menu pointss and dont know how to fix my problem

Code:
function addDropDown(self, level, menuList)
    if UIDROPDOWNMENU_OPEN_MENU.which == "BN_FRIEND" or UIDROPDOWNMENU_OPEN_MENU.which == "BN_FRIEND_OFFLINE" then
        local info = UIDropDownMenu_CreateInfo()

        if level == 1 then  
            info.text = "First Button"
            info.menuList = "test1"
            info.hasArrow = true

            UIDropDownMenu_AddButton(info)
        elseif menuList == "test1" then
            info.text = "Submenu"
            UIDropDownMenu_AddButton(info, level)
        end
    end
end

hooksecurefunc("FriendsFrameBNDropDown_Initialize", addDropDown)
hooksecurefunc("FriendsFrameBNOfflineDropDown_Initialize", addDropDown)
the menu should only appear if you rightclick a bnet friend.
the "first button" works but when i put my mouse over it..


Code:
3x FrameXML\UnitPopuplua:449: bad argument #1 to 'ipairs' (table expected, got nil)
[string "=[C]"]: in function `ipairs'
[string "FrameXML\UnitPopuplua"]:449: in function `UnitPopup_ShowMenu'
[string "FrameXML\FriendsFramelua"]:239: in function <FrameXML\FriendsFramelua:238>
[string "=[C]"]: in function `initFunction'
[string "SharedXML\UIDropDownMenulua"]:78: in function `UIDropDownMenu_Initialize'
[string "SharedXML\UIDropDownMenulua"]:1055: in function `ToggleDropDownMenu'
[string "SharedXML\UIDropDownMenulua"]:172: in function <SharedXML\UIDropDownMenulua:167>

Locals:
(*temporary) = nil
(*temporary) = "table expected, got nil"
 = <function> defined =[C]:-1