Merge "Move loading of mediawiki.toc from Parser to Skin"
[lhc/web/wiklou.git] / includes / user / User.php
index bb1e751..3317a1b 100644 (file)
@@ -522,7 +522,6 @@ class User implements IDBAccessObject {
                                }
 
                                return $data;
-
                        },
                        [ 'pcTTL' => $cache::TTL_PROC_LONG, 'version' => self::VERSION ]
                );
@@ -4171,6 +4170,10 @@ class User implements IDBAccessObject {
                        $this->setToken(); // init token
                }
 
+               if ( !is_string( $this->mName ) ) {
+                       throw new RuntimeException( "User name field is not set." );
+               }
+
                $this->mTouched = $this->newTouchedTimestamp();
 
                $noPass = PasswordFactory::newInvalidPassword()->toString();