gephi / gephi-plugins

Repository for Gephi Plugins maintained by the team. Each plugin has it's branch.
270 stars 623 forks source link

null pointer exception #88

Closed AmaniChou closed 2 years ago

AmaniChou commented 8 years ago

I implemented a new metric for nodes. in my loop on the graph nodes, I use n.setAttribute(NEWMETRIC, newMetric) to add the computed value in the nodes table. I already usednodeTable.addColumn(NEWMETRIC, NbBundle.getMessage(NewMetric.class, "NewMetric.nodecolumn.NewMetric"), Double.class, 0.0); to add the column to the nodes table. the null pointer is located in the setAtrribute instruction. Did I miss somthing ?

Exception: java.lang.NullPointerException at org.gephi.graph.impl.ElementImpl.checkColumn(ElementImpl.java:705) at org.gephi.graph.impl.ElementImpl.setAttribute(ElementImpl.java:318) at org.gephi.graph.impl.ElementImpl.setAttribute(ElementImpl.java:313) PS: my new_metric's class iimplements only statisctics interface

mbastian commented 8 years ago

Hi, can you share your code as this is not straightforward and maybe you're not initializing something correctly.