Fixed primary application if not in a group
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Mar 2012 14:49:08 +0000 (15:49 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Mar 2012 14:49:08 +0000 (15:49 +0100)
wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php

index a548e67ab7c39399f2bc6dc57baabb45f82357c6..0a9b32ed966c3a1b882ea60b98800c38b1d869a7 100644 (file)
@@ -40,7 +40,8 @@ class ApplicationHandler extends SingletonFactory {
         * @return      wcf\data\application\Application
         */
        public function getPrimaryApplication() {
-               return $this->cache['application'][$this->cache['primary']];
+               $packageID = ($this->cache['primary']) ?: PACKAGE_ID;
+               return $this->cache['application'][$packageID];
        }
        
        /**