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 f448281 commit e82c30e
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 e82c30e

Please sign in to comment.