fixed npe

This commit is contained in:
bancika
2011-01-12 20:43:51 +00:00
parent dd1ec04f1c
commit 23f4cb7468
2 changed files with 8 additions and 2 deletions
@@ -199,8 +199,11 @@ public class StatusBar extends JPanel implements IPlugIn {
break; break;
case SELECTION_SIZE_CHANGED: case SELECTION_SIZE_CHANGED:
Point2D size = (Point2D) params[0]; Point2D size = (Point2D) params[0];
boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem( Boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem(
Presenter.METRIC_KEY); Presenter.METRIC_KEY);
if (isMetric == null) {
isMetric = true;
}
if (size == null) { if (size == null) {
getSizeLabel().setText("N/A"); getSizeLabel().setText("N/A");
} else { } else {
@@ -752,8 +752,11 @@ public class Presenter implements IPlugInPort {
if (selectedComponents.isEmpty()) { if (selectedComponents.isEmpty()) {
return null; return null;
} }
boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem( Boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem(
METRIC_KEY); METRIC_KEY);
if (isMetric == null) {
isMetric = true;
}
Area area = new Area(); Area area = new Area();
for (IDIYComponent<?> component : selectedComponents) { for (IDIYComponent<?> component : selectedComponents) {
Area componentArea = componentAreaMap.get(component); Area componentArea = componentAreaMap.get(component);