(bug 26854) Invalid user names go unchecked. Applied most of the patch submitted...
[lhc/web/wiklou.git] / maintenance / changePassword.php
index ef87dfb..cfcac40 100644 (file)
@@ -43,7 +43,7 @@ class ChangePassword extends Maintenance {
                } else {
                        $this->error( "A \"user\" or \"userid\" must be set to change the password for" , true );
                }
-               if ( !$user->getId() ) {
+               if ( !$user || !$user->getId() ) {
                        $this->error( "No such user: " . $this->getOption( 'user' ), true );
                }
                try {