Extras: FlatInspector: fixed NPE if component class is in default package

This commit is contained in:
Karl Tauber
2021-03-16 13:46:25 +01:00
parent 46852c0780
commit 07db6e8fb0

View File

@@ -435,7 +435,8 @@ public class FlatInspector
String name = c.getClass().getName(); String name = c.getClass().getName();
name = name.substring( name.lastIndexOf( '.' ) + 1 ); name = name.substring( name.lastIndexOf( '.' ) + 1 );
appendRow( buf, "Class", name + " (" + c.getClass().getPackage().getName() + ")" ); Package pkg = c.getClass().getPackage();
appendRow( buf, "Class", name + " (" + (pkg != null ? pkg.getName() : "-") + ")" );
appendRow( buf, "Size", c.getWidth() + ", " + c.getHeight() + "   @ " + c.getX() + ", " + c.getY() ); appendRow( buf, "Size", c.getWidth() + ", " + c.getHeight() + "   @ " + c.getX() + ", " + c.getY() );
if( c instanceof Container ) if( c instanceof Container )