Commit ef4708e7 authored by Christian Hoesel's avatar Christian Hoesel 🎺

potentielle NPE beim Platzieren vom MQ's verhindert

parent 8049860d
......@@ -24,6 +24,7 @@
<import plugin="org.eclipse.emf.ecore"/>
<import plugin="com.bitctrl.lib.eclipse.emf.dav"/>
<import plugin="com.bitctrl.lib.eclipse.emf.davbitctrl"/>
<import plugin="de.bsvrz.buv.plugin.dobj" version="4.0.0" match="compatible"/>
<import plugin="com.bitctrl.lib.eclipse.emf"/>
<import plugin="com.bitctrl.lib.eclipse.emf.gef"/>
<import plugin="org.eclipse.emf.edit"/>
......@@ -32,7 +33,6 @@
<import plugin="de.bsvrz.buv.plugin.netz" version="5.1.0" match="compatible"/>
<import plugin="de.bsvrz.buv.rw.basislib" version="3.0.0" match="greaterOrEqual"/>
<import feature="de.bsvrz.buv.rw.bitctrl.feature" version="3.0.0" match="greaterOrEqual"/>
<import plugin="de.bsvrz.buv.plugin.dobj" version="4.0.0" match="compatible"/>
</requires>
<plugin
......
......@@ -283,7 +283,7 @@ final class MessQuerschnittNBAHanFigure extends Polygon
}
setLineWidthFloat((float) (1 / zoom));
final Point a;
Point a;
final double winkel;
if (isAnLinieAusrichten()) {
/**
......@@ -291,9 +291,16 @@ final class MessQuerschnittNBAHanFigure extends Polygon
*/
a = LinAlgUtil.getPunktNebenPunktListeAnfang(streckenabschnitt,
calculateLinienabstand() / combinedScale);
a.translate(new PrecisionPoint((-ABSTAND) / combinedScale,
(-ABSTAND / 2) / combinedScale));
if (a != null) {
a.translate(new PrecisionPoint((-ABSTAND) / combinedScale,
(-ABSTAND / 2) / combinedScale));
} else {
if (hotspot != null) {
a = hotspot;
} else {
a = new Point(0, ABSTAND / 2);
}
}
// Am Streckenabschnitt ausrichten
final double dX = streckenabschnitt.getPoint(0).preciseX()
- streckenabschnitt.getPoint(1).preciseX();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment