#fixed code
                                private Version parseVersion() {
        int major = intOf(consumeNextToken(NUMERIC).lexeme);
        int minor = 0;
        if (tokens.positiveLookahead(DOT)) {
            tokens.consume();
            minor = intOf(consumeNextToken(NUMERIC).lexeme);
        }
        int patch = 0;
        if (tokens.positiveLookahead(DOT)) {
            tokens.consume();
            patch = intOf(consumeNextToken(NUMERIC).lexeme);
        }
        return versionOf(major, minor, patch);
    }
#vulnerable code 
                                private Version parseVersion() {
        int major = intOf(tokens.consume(NUMERIC).lexeme);
        int minor = 0;
        if (tokens.positiveLookahead(DOT)) {
            tokens.consume();
            minor = intOf(tokens.consume(NUMERIC).lexeme);
        }
        int patch = 0;
        if (tokens.positiveLookahead(DOT)) {
            tokens.consume();
            patch = intOf(tokens.consume(NUMERIC).lexeme);
        }
        return versionOf(major, minor, patch);
    } 
                            #location 2 
                            #vulnerability type NULL_DEREFERENCE