Avoid notice on profile close errors
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 13 Jul 2011 22:59:55 +0000 (22:59 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 13 Jul 2011 22:59:55 +0000 (22:59 +0000)
includes/profiler/ProfilerSimpleText.php

index f54b0e5..ef9049f 100644 (file)
@@ -28,7 +28,9 @@ class ProfilerSimpleText extends ProfilerSimple {
        public function logData() {
                if ( $this->mTemplated ) {
                        $this->close();
-                       $totalReal = $this->mCollated['-total']['real'];
+                       $totalReal = isset( $this->mCollated['-total'] )
+                               ? $this->mCollated['-total']['real']
+                               : 0; // profiling mismatch error?
                        uasort( $this->mCollated, array('self','sort') );
                        array_walk( $this->mCollated, array('self','format'), $totalReal );
                        if ( $this->visible ) {