ZF2-514: Fatal error thrown when accessing merge method on non-existing object


A fatal error is thrown on line 576 of \Zend\Db\Sql\Select.php when trying to use Expr in a join, such as:

    array('u' => 'users'),
    'othertable.originator_id = u.id',
    array('person' => new Expr("IF(u.id = 1, NULL, u.username)"))


Forgot to mention that line 576 just needs to have a check for $parameterContainer being non-empty, such as:

if ($parameterContainer) {

Send a pull request for this: https://github.com/zendframework/zf2/pull/2291

Fixed with @koen's patch.