Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
2b7c6936
Commit
2b7c6936
authored
Sep 29, 2026
by
Luna Riegel
Browse files
Fix: Fix potential NPE in check
parent
ab403389
Changes
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/checks/topology/MisalignedUtilityConnectionCheck.java
View file @
2b7c6936
...
...
@@ -281,8 +281,7 @@ public class MisalignedUtilityConnectionCheck extends Check {
// Calculate intersection plane
if
(!
intersections
.
isEmpty
())
{
List
<
Vector3d
>
intersectPoints
=
intersections
.
stream
()
.
flatMap
(
isect
->
isect
.
getLines
().
stream
())
.
flatMap
(
segment
->
Stream
.
of
(
segment
.
getPointA
(),
segment
.
getPointB
()))
.
flatMap
(
this
::
getIntersectionPoints
)
.
toList
();
if
(!
intersectPoints
.
isEmpty
())
{
...
...
@@ -299,6 +298,17 @@ public class MisalignedUtilityConnectionCheck extends Check {
return
OrthogonalRegressionPlane
.
calculateOrthogonalRegressionPlane
(
sPairVerts
);
}
private
Stream
<
Vector3d
>
getIntersectionPoints
(
PolygonIntersection
isect
)
{
if
(
isect
.
getLines
()
!=
null
)
{
return
isect
.
getLines
().
stream
().
flatMap
(
segment
->
Stream
.
of
(
segment
.
getPointA
(),
segment
.
getPointB
()));
}
if
(
isect
.
getT1
()
!=
null
&&
isect
.
getT2
()
!=
null
)
{
return
Stream
.
of
(
isect
.
getT1
().
getP1
(),
isect
.
getT1
().
getP2
(),
isect
.
getT1
().
getP3
(),
isect
.
getT2
().
getP1
(),
isect
.
getT2
().
getP2
(),
isect
.
getT2
().
getP3
());
}
return
Stream
.
empty
();
}
private
boolean
isPlanarToPlane
(
List
<
Vertex
>
verts
,
Plane
plane
,
double
eps
)
{
if
(
verts
.
isEmpty
())
{
return
true
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment