<?php

class DownloadableOrderItemExtension extends DataExtension
{

    public function getDownloadLink()
    {
        $order = Order::get()->byID($this->owner->ParentID);

        if ($match = $this->owner->match()) {
            return $match->getDownloadLink().
                '?o='.$order->ID.
                '&k='.$order->AccessKey;
        }

        return false;
    }
}
<?php

class DownloadableOrderItemExtension extends DataExtension
{

    public function getDownloadLink()
    {
        $order = Order::get()->byID($this->owner->ParentID);
        $match = $this->owner->match();

        if ($match && method_exists($match, "getDownloadLink")) {
            return $match->getDownloadLink().
                '?o='.$order->ID.
                '&k='.$order->AccessKey;
        }

        return false;
    }
}
Add check to ensure item has a download link
Add check to ensure item has a download link
