Skip to content

Commit

Permalink
Support if annotation is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Sep 27, 2024
1 parent 22405c3 commit cb0bfe0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ScaffoldingControllerInjector implements GrailsArtefactClassInjector {
}
}
classNode.setSuperClass(GrailsASTUtils.nonGeneric(superClassNode, domainClass))
def readOnlyExpression = (ConstantExpression) annotationNode.getMember("readOnly")
def readOnlyExpression = (ConstantExpression) annotationNode?.getMember("readOnly")
new ResourceTransform().addConstructor(classNode, domainClass, readOnlyExpression?.getValue()?.asBoolean()?:false)
} else if (!currentSuperClass.isDerivedFrom(superClassNode)) {
GrailsASTUtils.error(source, classNode, "Scaffolded controllers (${classNode.name}) cannot extend other classes: ${currentSuperClass.getName()}", true)
Expand Down

0 comments on commit cb0bfe0

Please sign in to comment.