Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java @ 3140:3d456d8bca6e
TimeseriesChartGenerator: Prevent some NPEs
flys-artifacts/trunk@4748 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 21 Jun 2012 15:27:57 +0000 |
parents | 5888c4685701 |
children | e10323bf3cbc |
comparison
equal
deleted
inserted
replaced
3139:5888c4685701 | 3140:3d456d8bca6e |
---|---|
434 | 434 |
435 newBounds.applyBounds(axis, AXIS_SPACE); | 435 newBounds.applyBounds(axis, AXIS_SPACE); |
436 } | 436 } |
437 else { | 437 else { |
438 logger.debug("No user specified zoom values found!"); | 438 logger.debug("No user specified zoom values found!"); |
439 total.applyBounds(axis, AXIS_SPACE); | 439 if (total != null && axis != null) { |
440 total.applyBounds(axis, AXIS_SPACE); | |
441 } | |
440 } | 442 } |
441 } | 443 } |
442 | 444 |
443 | 445 |
444 protected void zoomY( | 446 protected void zoomY( |
467 | 469 |
468 newBounds.applyBounds(axis, AXIS_SPACE); | 470 newBounds.applyBounds(axis, AXIS_SPACE); |
469 } | 471 } |
470 else { | 472 else { |
471 logger.debug("No user specified zoom values found!"); | 473 logger.debug("No user specified zoom values found!"); |
472 total.applyBounds(axis, AXIS_SPACE); | 474 if (total != null && axis != null) { |
475 total.applyBounds(axis, AXIS_SPACE); | |
476 } | |
473 } | 477 } |
474 } | 478 } |
475 | 479 |
476 | 480 |
477 /** | 481 /** |
692 | 696 |
693 protected void applySeriesAttributes(XYPlot plot) { | 697 protected void applySeriesAttributes(XYPlot plot) { |
694 int count = plot.getDatasetCount(); | 698 int count = plot.getDatasetCount(); |
695 for (int i = 0; i < count; i++) { | 699 for (int i = 0; i < count; i++) { |
696 XYDataset data = plot.getDataset(i); | 700 XYDataset data = plot.getDataset(i); |
701 if (data == null) { | |
702 continue; | |
703 } | |
697 int seriesCount = data.getSeriesCount(); | 704 int seriesCount = data.getSeriesCount(); |
698 for (int j = 0; j < seriesCount; j++) { | 705 for (int j = 0; j < seriesCount; j++) { |
699 StyledTimeSeries series = | 706 StyledTimeSeries series = |
700 (StyledTimeSeries)getSeriesOf(data, j); | 707 (StyledTimeSeries)getSeriesOf(data, j); |
701 String key = series.getKey().toString(); | 708 String key = series.getKey().toString(); |