Commit 6db7cf65 authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Fixed potential NPE for some Bypass Evaluations w/o Vis

parent 21216cd4
......@@ -519,6 +519,9 @@ public class VisualizationTopologyView extends JFrame
* @version 1.0, 03.04.2012
*/
public static class VisualizationInjector {
private static boolean isActive = false;
protected static WorldPanel worldPanel;
public static ComponentVisManager visManager;
......@@ -588,6 +591,7 @@ public class VisualizationTopologyView extends JFrame
VisualizationInjector.visManager = visManager;
VisualizationInjector.WORLD_X = WORLD_X;
VisualizationInjector.WORLD_Y = WORLD_Y;
VisualizationInjector.isActive = true;
for (VisInfo visInfo : components) {
visManager.addComponent(visInfo);
......@@ -598,6 +602,14 @@ public class VisualizationTopologyView extends JFrame
setupAWTEventListener();
}
/**
* True if this component is active at all (can be used)
* @return
*/
public static boolean isActive() {
return isActive;
}
public static VisualizationTopologyView getTopologyView() {
return view;
......@@ -800,6 +812,9 @@ public class VisualizationTopologyView extends JFrame
* @param comp
*/
public static void injectComponent(VisualizationComponent comp) {
if (!isActive()) {
return;
}
visManager.addComponent(comp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment