Skip to content

Commit 8e5fcc1

Browse files
mriveraleehalfhp
authored andcommitted
Fix crash when clearing SimpleXYSeries with ArrayFormat SimpleXYSeries.ArrayFormat.Y_VALS_ONLY (halfhp#31)
1 parent 84e4fa2 commit 8e5fcc1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

androidplot-core/src/main/java/com/androidplot/xy/SimpleXYSeries.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ public LinkedList<Number> getyVals() {
341341
public void clear() {
342342
lock.writeLock().lock();
343343
try {
344-
xVals.clear();
344+
if (xVals != null) {
345+
xVals.clear();
346+
}
345347
yVals.clear();
346348
} finally {
347349
lock.writeLock().unlock();

0 commit comments

Comments
 (0)