Skip to content

Commit 79fa039

Browse files
Fixes a NPE.
1 parent 15c75f2 commit 79fa039

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

structurizr-inspection/src/main/java/com/structurizr/inspection/documentation/AbstractDocumentableInspection.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ public final Violation run(Documentable documentable) {
4040
protected Set<String> findEmbeddedViewKeys(Documentable documentable) {
4141
Set<String> keys = new LinkedHashSet<>();
4242

43-
for (Section section : documentable.getDocumentation().getSections()) {
44-
keys.addAll(findEmbeddedViewKeys(section));
45-
}
43+
if (documentable.getDocumentation() != null) {
44+
for (Section section : documentable.getDocumentation().getSections()) {
45+
keys.addAll(findEmbeddedViewKeys(section));
46+
}
4647

47-
for (Decision decision : documentable.getDocumentation().getDecisions()) {
48-
keys.addAll(findEmbeddedViewKeys(decision));
48+
for (Decision decision : documentable.getDocumentation().getDecisions()) {
49+
keys.addAll(findEmbeddedViewKeys(decision));
50+
}
4951
}
5052

5153
return keys;

0 commit comments

Comments
 (0)