Fix deleting CLI session without proper login credentials
authorMatthias Schmidt <gravatronics@live.com>
Sat, 17 Jan 2015 20:00:53 +0000 (21:00 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 17 Jan 2015 20:00:53 +0000 (21:00 +0100)
Close #1861

wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index aa3a2929304318980030250e7399efd186738dba..0337999cc1764c4bf665e1730e40263d8950788d 100644 (file)
@@ -705,8 +705,10 @@ class SessionHandler extends SingletonFactory {
                        //
                        case 0:
                                // delete virtual session
-                               $virtualSessionEditor = new SessionVirtualEditor($this->virtualSession);
-                               $virtualSessionEditor->delete();
+                               if ($this->virtualSession) {
+                                       $virtualSessionEditor = new SessionVirtualEditor($this->virtualSession);
+                                       $virtualSessionEditor->delete();
+                               }
                                
                                // there are still other virtual sessions, create a new session
                                if (SessionVirtual::countVirtualSessions($this->session->sessionID)) {