Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

catch and log a warning in RasterPlotter

Michael Peter Christen45641b0c236b
diff --git a/source/net/yacy/visualization/RasterPlotter.java b/source/net/yacy/visualization/RasterPlotter.java
index 9f193a730..d6eb08da8 100644
--- a/source/net/yacy/visualization/RasterPlotter.java
+++ b/source/net/yacy/visualization/RasterPlotter.java
@@ -165,6 +165,7 @@ public class RasterPlotter {
public void plot(final int x, final int y, final int intensity) {
if ((x < 0) || (x >= this.width)) return;
if ((y < 0) || (y >= this.height)) return;
+ try {
if (this.defaultMode == DrawMode.MODE_REPLACE) {
if (intensity == 100) synchronized (this.cc) {
this.cc[0] = this.defaultColR;
@@ -215,6 +216,9 @@ public class RasterPlotter {
}
this.grid.setPixel(x, y, c);
}
+ } catch (ArrayIndexOutOfBoundsException e) {
+ Log.logWarning("RasterPlotter", e.getMessage() + ": x = " + x + ", y = " + y);
+ } // may appear when pixel coordinate is out of bounds
}
public void line(final int Ax, final int Ay, final int Bx, final int By, final int intensity) {