Skip to content

Commit

Permalink
constructorParams fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rukavina committed Sep 10, 2015
1 parent 9f89f8d commit 2985e90
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/MgKurentoClient/JsonRpc/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ public function receive($data){
* @return mixed
*/
public function sendCreate($type, $creationParams, callable $callback){
return $this->send('create', array(
'type' => $type,
'constructorParams' => $creationParams
), $callback);
$message = array(
'type' => $type
);
if(isset($creationParams) && count($creationParams)){
$message['constructorParams'] = $creationParams;
}
return $this->send('create', $message, $callback);
}

/**
Expand Down

0 comments on commit 2985e90

Please sign in to comment.