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;
case SELECTION_SIZE_CHANGED:
Point2D size = (Point2D) params[0];
boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem(
Boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem(
Presenter.METRIC_KEY);
if (isMetric == null) {
isMetric = true;
}
if (size == null) {
getSizeLabel().setText("N/A");
} else {
@@ -752,8 +752,11 @@ public class Presenter implements IPlugInPort {
if (selectedComponents.isEmpty()) {
return null;
}
boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem(
Boolean isMetric = (Boolean) ConfigurationManager.getInstance().getConfigurationItem(
METRIC_KEY);
if (isMetric == null) {
isMetric = true;
}
Area area = new Area();
for (IDIYComponent<?> component : selectedComponents) {
Area componentArea = componentAreaMap.get(component);