diff --git a/src/main/groovy/org/grails/compiler/scaffolding/ScaffoldingControllerInjector.groovy b/src/main/groovy/org/grails/compiler/scaffolding/ScaffoldingControllerInjector.groovy index b44e53b..f0727d9 100644 --- a/src/main/groovy/org/grails/compiler/scaffolding/ScaffoldingControllerInjector.groovy +++ b/src/main/groovy/org/grails/compiler/scaffolding/ScaffoldingControllerInjector.groovy @@ -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)