mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
null check
This commit is contained in:
@@ -78,7 +78,7 @@ public class AirCoreInductor extends AbstractLeadedComponent<Inductance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString();
|
||||
return getValue() == null ? "" : getValue().toString();
|
||||
}
|
||||
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class AxialElectrolyticCapacitor extends AbstractLeadedComponent<Capacita
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -87,7 +87,7 @@ public class AxialFilmCapacitor extends AbstractLeadedComponent<Capacitance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Voltage")
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CapacitorSymbol extends AbstractSchematicLeadedSymbol<Capacitance>
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -84,7 +84,7 @@ public class InductorSymbol extends AbstractSchematicLeadedSymbol<Inductance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getCurrent() == null ? "" : " " + getCurrent().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getCurrent() == null ? "" : " " + getCurrent().toString());
|
||||
}
|
||||
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class RadialCeramicDiskCapacitor extends AbstractRadialComponent<Capacita
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Voltage")
|
||||
|
||||
@@ -91,7 +91,7 @@ public class RadialElectrolytic extends AbstractRadialComponent<Capacitance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -72,7 +72,7 @@ public class RadialFilmCapacitor extends AbstractRadialComponent<Capacitance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -86,7 +86,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getPowerNew() == null ? "" : " " + getPowerNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getPowerNew() == null ? "" : " " + getPowerNew().toString());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ResistorSymbol extends AbstractSchematicLeadedSymbol<Resistance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getPowerNew() == null ? "" : " " + getPowerNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getPowerNew() == null ? "" : " " + getPowerNew().toString());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -87,7 +87,7 @@ public class TantalumCapacitor extends AbstractRadialComponent<Capacitance> {
|
||||
|
||||
@Override
|
||||
public String getValueForDisplay() {
|
||||
return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Voltage")
|
||||
|
||||
Reference in New Issue
Block a user