better return check in Magicsig::staticGet()

This commit is contained in:
James Walker 2010-02-26 17:52:12 -05:00
parent a5cfda8505
commit ee7603b09f

View File

@ -50,7 +50,11 @@ class Magicsig extends Memcached_DataObject
public /*static*/ function staticGet($k, $v=null) public /*static*/ function staticGet($k, $v=null)
{ {
$obj = parent::staticGet(__CLASS__, $k, $v); $obj = parent::staticGet(__CLASS__, $k, $v);
return Magicsig::fromString($obj->keypair); if (!empty($obj)) {
return Magicsig::fromString($obj->keypair);
}
return $obj;
} }