Skip to content

Defensive code required in LineItem #910

@OS4

Description

@OS4

vendor/calcinai/xero-php/src/XeroPHP/Models/Accounting/LineItem.php line 253 is currently

    public function getItemCode()
    {
        return $this->_data['ItemCode'];
    }

I believe that something like

    public function getItemCode()
    {
        if (isset($this->_data) && isset($this->_data['ItemCode'])) {
            return $this->_data['ItemCode'];
        } else {
            return "";
        }
    }

Is required to stop errors being thrown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions