* i.e. user => id, user_text => text
*
* @param $user User for the spec
- * @param $idfield Field name containing the identifier
- * @param $utfield Field name containing the user text
+ * @param $idfield string Field name containing the identifier
+ * @param $utfield string Field name containing the user text
* @return array
*/
private function userSpecification( &$user, $idfield, $utfield ) {
$user->setName( $username );
} else {
$user = User::newFromName( $username );
+ if ( !$user ) {
+ $this->error( "Invalid username", true );
+ }
}
$user->load();
return $user;