diff options
-rw-r--r-- | client/src/com/vaadin/client/Profiler.java | 18 | ||||
-rw-r--r-- | client/src/com/vaadin/client/debug/internal/ProfilerSection.java | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/client/src/com/vaadin/client/Profiler.java b/client/src/com/vaadin/client/Profiler.java index bcbf8279f3..083f2559b1 100644 --- a/client/src/com/vaadin/client/Profiler.java +++ b/client/src/com/vaadin/client/Profiler.java @@ -273,7 +273,9 @@ public class Profiler { } }); - getConsumer().addProfilerData(stack.getFirst(), totalList); + if (getConsumer() != null) { + getConsumer().addProfilerData(stack.getFirst(), totalList); + } } /** @@ -325,7 +327,9 @@ public class Profiler { return; } - getConsumer().addBootstrapData(timings); + if (getConsumer() != null) { + getConsumer().addBootstrapData(timings); + } } } @@ -386,11 +390,11 @@ public class Profiler { * <b>Warning!</b> This is internal API and should not be used by * applications or add-ons. * - * @since 7.1 + * @since 7.1.4 * @param profilerResultConsumer * the consumer that gets profiler data */ - public static void setProfilerResultConsuer( + public static void setProfilerResultConsumer( ProfilerResultConsumer profilerResultConsumer) { if (consumer != null) { throw new IllegalStateException("The consumer has already been set"); @@ -399,11 +403,7 @@ public class Profiler { } private static ProfilerResultConsumer getConsumer() { - if (consumer == null) { - throw new IllegalStateException("No consumer has been registered"); - } else { - return consumer; - } + return consumer; } private static Logger getLogger() { diff --git a/client/src/com/vaadin/client/debug/internal/ProfilerSection.java b/client/src/com/vaadin/client/debug/internal/ProfilerSection.java index 91f626b9a5..4a2a3a1c38 100644 --- a/client/src/com/vaadin/client/debug/internal/ProfilerSection.java +++ b/client/src/com/vaadin/client/debug/internal/ProfilerSection.java @@ -283,7 +283,7 @@ public class ProfilerSection implements Section { private final FlowPanel content = new FlowPanel(); public ProfilerSection() { - Profiler.setProfilerResultConsuer(new ProfilerResultConsumer() { + Profiler.setProfilerResultConsumer(new ProfilerResultConsumer() { @Override public void addProfilerData(Node rootNode, List<Node> totals) { double totalTime = 0; |