#fixed code
                                private void performVersionCodeUpdateFromVersion( Element manifestElement )
    {
        String verString = project.getVersion();
        getLog().debug( "Generating versionCode for " + verString );
        String verCode = generateVersionCodeFromVersionName( verString );
        getLog().info( "Setting " + ATTR_VERSION_CODE + " to " + verCode );
        manifestElement.setAttribute( ATTR_VERSION_CODE, verCode );
        project.getProperties().setProperty( "android.manifest.versionCode", String.valueOf( verCode ) );
    }
#vulnerable code 
                                private void performVersionCodeUpdateFromVersion( Element manifestElement )
    {
        String verString = project.getVersion();
        getLog().debug( "Generating versionCode for " + verString );
        ArtifactVersion artifactVersion = new DefaultArtifactVersion( verString );
        String verCode;
        if ( artifactVersion.getMajorVersion() < 1 && artifactVersion.getMinorVersion() < 1
             && artifactVersion.getIncrementalVersion() < 1 )
        {
            getLog().warn( "Problem parsing version number occurred. Using fall back to determine version code. " );

            verCode = verString.replaceAll( "\\D", "" );

            Attr versionCodeAttr = manifestElement.getAttributeNode( ATTR_VERSION_CODE );
            int currentVersionCode = 0;
            if ( versionCodeAttr != null )
            {
                currentVersionCode = NumberUtils.toInt( versionCodeAttr.getValue(), 0 );
            }

            if ( Integer.parseInt( verCode ) < currentVersionCode )
            {
                getLog().info( verCode + " < " + currentVersionCode + " so padding versionCode" );
                verCode = StringUtils.rightPad( verCode, versionCodeAttr.getValue().length(), "0" );
            }
        }
        else
        {
            verCode = Integer.toString( artifactVersion.getMajorVersion() * MAJOR_VERSION_POSITION
                    + artifactVersion.getMinorVersion() * MINOR_VERSION_POSITION
                    + artifactVersion.getIncrementalVersion() * INCREMENTAL_VERSION_POSITION );
        }
        getLog().info( "Setting " + ATTR_VERSION_CODE + " to " + verCode );
        manifestElement.setAttribute( ATTR_VERSION_CODE, verCode );
        project.getProperties().setProperty( "android.manifest.versionCode", String.valueOf( verCode ) );
    } 
                            #location 24 
                            #vulnerability type NULL_DEREFERENCE