Buggy code:
public static final AttributeDefinition MANAGEMENT_MICRO_VERSION = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . MANAGEMENT_MICRO_VERSION , ModelType . INT , false ) . setValidator ( new org . jboss . as . controller . operations . validation . IntRangeValidator ( 0 ) ) . build ( ) ; public static final AttributeDefinition PROFILE_NAME = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . PROFILE_NAME , ModelType . STRING , false ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final AttributeDefinition SERVER_STATE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . PROCESS_STATE , ModelType . STRING ) . setStorageRuntime ( ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final AttributeDefinition PROCESS_TYPE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . PROCESS_TYPE , ModelType . STRING ) . setStorageRuntime ( ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final AttributeDefinition LAUNCH_TYPE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . LAUNCH_TYPE , ModelType . STRING ) . setValidator ( new org . jboss . as . controller . operations . validation . EnumValidator < org . jboss . as . server . ServerEnvironment . LaunchType > ( org . jboss . as . server . ServerEnvironment . LaunchType . class , false , false ) ) . setStorageRuntime ( ) . build ( ) ; private static final EnumSet < Flag > runtimeOnlyFlag = EnumSet . of ( RUNTIME_ONLY ) ; private final boolean isDomain ; private final ContentRepository contentRepository ; private final ExtensibleConfigurationPersister extensibleConfigurationPersister ; private final ServerEnvironment serverEnvironment ; private final ControlledProcessState processState ; private final RunningModeControl runningModeControl ; private final AbstractVaultReader vaultReader ; private final ExtensionRegistry extensionRegistry ; private final boolean parallelBoot ; private final PathManagerService pathManager ; public ServerRootResourceDefinition ( final ContentRepository contentRepository , final ExtensibleConfigurationPersister extensibleConfigurationPersister , final ServerEnvironment serverEnvironment , final ControlledProcessState processState , final RunningModeControl runningModeControl , final AbstractVaultReader vaultReader , final ExtensionRegistry extensionRegistry , final boolean parallelBoot , final PathManagerService pathManager ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } private static class ManagementVersionAttributeHandler implements OperationStepHandler { static final OperationStepHandler INSTANCE = new ServerRootResourceDefinition . ManagementVersionAttributeHandler ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { String attr = operation . get ( ModelDescriptionConstants . NAME ) . asString ( ) ; if ( attr . equals ( ModelDescriptionConstants . MANAGEMENT_MAJOR_VERSION ) ) { context . getResult ( ) . set ( Version . MANAGEMENT_MAJOR_VERSION ) ; } else if ( attr . equals ( ModelDescriptionConstants . MANAGEMENT_MINOR_VERSION ) ) { context . getResult ( ) . set ( Version . MANAGEMENT_MINOR_VERSION ) ; } else if ( attr . equals ( ModelDescriptionConstants . MANAGEMENT_MICRO_VERSION ) ) { context . getResult ( ) . set ( Version . MANAGEMENT_MICRO_VERSION ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } } private static class ReleaseVersionAttributeHandler implements OperationStepHandler { static final OperationStepHandler INSTANCE = new ServerRootResourceDefinition . ReleaseVersionAttributeHandler ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { String attr = operation . get ( ModelDescriptionConstants . NAME ) . asString ( ) ; try { if ( attr . equals ( ModelDescriptionConstants . RELEASE_VERSION ) ) { context . getResult ( ) . set ( AS_VERSION ) ; } else if ( attr . equals ( ModelDescriptionConstants . RELEASE_CODENAME ) ) { context . getResult ( ) . set ( AS_RELEASE_CODENAME ) ; } } catch ( RuntimeException e ) { if ( ( SecurityActions . getClassLoader ( this . getClass ( ) ) ) instanceof ModuleClassLoader ) { throw new OperationFailedException ( e . getMessage ( ) ) ; } context . getResult ( ) . set ( "-" ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } } private static class ProductInfoAttributeHandler implements OperationStepHandler { final ServerEnvironment env ; public ProductInfoAttributeHandler ( ServerEnvironment env ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { String attr = operation . get ( ModelDescriptionConstants . NAME ) . asString ( ) ; <START_BUG> if ( ( env ) != null ) { <END_BUG> if ( attr . equals ( ModelDescriptionConstants . PRODUCT_VERSION ) ) { String productVersion = env . getProductConfig ( ) . getProductVersion ( ) ; if ( productVersion != null ) { context . getResult ( ) . set ( productVersion ) ; } context . getResult ( ) ; } else if ( attr . equals ( ModelDescriptionConstants . PRODUCT_NAME ) ) { String productName = env . getProductConfig ( ) . getProductName ( ) ; if ( productName != null ) { context . getResult ( ) . set ( productName ) ; } } } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } } private static class DefaultEmptyListAttributeHandler implements OperationStepHandler { static final OperationStepHandler INSTANCE = new ServerRootResourceDefinition . DefaultEmptyListAttributeHandler ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { String attr = operation . get ( ModelDescriptionConstants . NAME ) . asString ( ) ; if ( attr . equals ( ModelDescriptionConstants . NAMESPACES ) ) { getAttributeValueOrDefault ( ServerRootResourceDefinition . NAMESPACES , context ) ; } else if ( attr . equals ( ModelDescriptionConstants . SCHEMA_LOCATIONS ) ) { getAttributeValueOrDefault ( ServerRootResourceDefinition . SCHEMA_LOCATIONS , context ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } private void getAttributeValueOrDefault ( AttributeDefinition def , OperationContext context ) throws OperationFailedException { } } }

Fix:
if ( ( ( env ) != null ) && ( ( env . getProductConfig ( ) ) != null ) ) {