felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r817183 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
Date Mon, 21 Sep 2009 07:44:30 GMT
Author: fmeschbe
Date: Mon Sep 21 07:44:24 2009
New Revision: 817183

URL: http://svn.apache.org/viewvc?rev=817183&view=rev
Log:
FELIX-1622 Prevent NullPointerException if no LogReaderService is
installed.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java?rev=817183&r1=817182&r2=817183&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
Mon Sep 21 07:44:24 2009
@@ -98,13 +98,17 @@
             jw.key( "data" );
             jw.array();
 
-            int index = 0;
-            for ( Enumeration logEntries = logReaderService.getLog(); logEntries.hasMoreElements()
&& index < MAX_LOGS; )
+            if ( logReaderService != null )
             {
-                LogEntry nextLog = ( LogEntry ) logEntries.nextElement();
-                if ( nextLog.getLevel() <= minLogLevel )
+                int index = 0;
+                for ( Enumeration logEntries = logReaderService.getLog(); logEntries.hasMoreElements()
+                    && index < MAX_LOGS; )
                 {
-                    logJson( jw, nextLog, index++ );
+                    LogEntry nextLog = ( LogEntry ) logEntries.nextElement();
+                    if ( nextLog.getLevel() <= minLogLevel )
+                    {
+                        logJson( jw, nextLog, index++ );
+                    }
                 }
             }
 



Mime
View raw message