From ff52c09006a3f6b4e24b534e5812269931163a89 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Wed, 5 Dec 2012 13:09:22 +0400 Subject: [PATCH] user exceptions fixed --- .../calculator/plot/CalculatorPlotFragment.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java b/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java index 80e95b33..95cf64d0 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java @@ -335,13 +335,15 @@ public class CalculatorPlotFragment extends CalculatorFragment implements Calcul } try { - if (PlotUtils.addXY(dr.getXAxisMin(), dr.getXAxisMax(), expression, variable, realSeries, imagSeries, true, PlotUtils.DEFAULT_NUMBER_OF_STEPS)) { - if (chart.getDataset().getSeriesCount() <= 1) { - chart.getDataset().addSeries(imagSeries); - chart.getRenderer().addSeriesRenderer(PlotUtils.createImagRenderer(imagLineColor.getColor())); - } - } - } catch (ArithmeticException e) { + if (dr != null) { + if (PlotUtils.addXY(dr.getXAxisMin(), dr.getXAxisMax(), expression, variable, realSeries, imagSeries, true, PlotUtils.DEFAULT_NUMBER_OF_STEPS)) { + if (chart.getDataset().getSeriesCount() <= 1) { + chart.getDataset().addSeries(imagSeries); + chart.getRenderer().addSeriesRenderer(PlotUtils.createImagRenderer(imagLineColor.getColor())); + } + } + } + } catch (ArithmeticException e) { PlotUtils.handleArithmeticException(e, CalculatorPlotFragment.this); }