[pLog-svn] r2042 - plog/branches/plog-1.1-ben/class/dao

ork at devel.plogworld.net ork at devel.plogworld.net
Sun May 22 16:29:47 GMT 2005


Author: ork
Date: 2005-05-22 16:29:46 +0000 (Sun, 22 May 2005)
New Revision: 2042

Modified:
   plog/branches/plog-1.1-ben/class/dao/users.class.php
Log:
userInfo might be false, if a new user is going to be created. don't try to getUsername() from false :)


Modified: plog/branches/plog-1.1-ben/class/dao/users.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/users.class.php	2005-05-22 16:25:36 UTC (rev 2041)
+++ plog/branches/plog-1.1-ben/class/dao/users.class.php	2005-05-22 16:29:46 UTC (rev 2042)
@@ -90,8 +90,10 @@
                           WHERE u.user = '".Db::qstr($username)."'";
                  $userInfo = $this->_getUserInfoFromQuery( $query );
 
-                 $this->_cache->setData( $userInfo->getUsername(), CACHE_USERIDBYNAME, $userInfo->getId() );
-                 $this->_cache->setData( $userInfo->getId(), CACHE_USERINFO, $userInfo );
+                 if ( $userInfo ) {
+                     $this->_cache->setData( $userInfo->getUsername(), CACHE_USERIDBYNAME, $userInfo->getId() );
+                     $this->_cache->setData( $userInfo->getId(), CACHE_USERINFO, $userInfo );
+                 }
 
                  return $userInfo;
             }




More information about the pLog-svn mailing list