mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
fixed npe
This commit is contained in:
+4
-1
@@ -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 {
|
||||||
|
|||||||
+4
-1
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user