-
- IConsoleSupport cs = Simantics.getSession().getService(IConsoleSupport.class);
- Variable root = ProxyVariables.proxyVariableRoot(graph, var);
- if(root == null) return Collections.emptyList();
- Variable session = root.getParent(graph);
- String guid = session.getName(graph);
- IConsole console = cs.getConsole(guid);
+
+ IConsole console = null;
+ IConsoleSupport cs = Simantics.getSession().peekService(IConsoleSupport.class);
+ if (cs != null) {
+ Variable root = ProxyVariables.proxyVariableRoot(graph, var);
+ if (root == null)
+ return Collections.emptyList();
+ Variable session = root.getParent(graph);
+ String guid = session.getName(graph);
+ console = cs.getConsole(guid);
+ }
+
+ SCLContext sclContext = SCLContext.getCurrent();