Skip to content

Commit 6119e98

Browse files
authored
Fix _setArgs to allow to create new projects using xmlrpc (#348)
1 parent 199a68e commit 6119e98

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/api/xmlrpc/v1/xmlrpc.class.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,12 @@ protected function _setArgs($args, $opt = null) {
292292
$this->args = $args;
293293

294294
if(isset( $this->args[self::$testProjectNameParamName] ) && ! isset( $this->args[self::$testProjectIDParamName] )) {
295-
$tprojMgr = new testproject( $this->dbObj );
296295
$name = trim( $this->args[self::$testProjectNameParamName] );
297-
$info = current( $this->tprojectMgr->get_by_name( $name ) );
298-
$this->args[self::$testProjectIDParamName] = $info['id'];
296+
$projects = $this->tprojectMgr->get_by_name( $name );
297+
if (! is_null( $projects )) {
298+
$info = current( $projects );
299+
$this->args[self::$testProjectIDParamName] = $info['id'];
300+
}
299301
}
300302
}
301303

0 commit comments

Comments
 (0)