[PATCH 4 of 6] Add NPE guard to XYStyle

Wald Commits scm-commit at wald.intevation.org
Thu Sep 26 09:59:52 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380125089 -7200
# Node ID 2d690611d11091fc368ca49929b282d5485f7bc6
# Parent  34b5e7ef2a36912672359ce65cb6826572812658
Add NPE guard to XYStyle.

diff -r 34b5e7ef2a36 -r 2d690611d110 artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java	Wed Sep 25 18:04:14 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java	Wed Sep 25 18:04:49 2013 +0200
@@ -41,7 +41,11 @@
      * whether to draw lines and/or points.
      */
     @Override
-    public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx){
+    public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx) {
+        if (theme == null) {
+            // Hurray we already applied nothing :)
+            return r;
+        }
         this.renderer = r;
         applyLineColor(r, idx);
         applyLineSize(r, idx);


More information about the Dive4elements-commits mailing list