Skip to content

Engine: NPEs accessing rid when it is null #31

Description

@giastfader

ArcadeDB Version: 21.9.1-SNAPSHOT

JDK Version: N/A

OS: N/A

I found at least two points where there is an explicit use of the rid variable when it is for sure null, because there is an explicit test on the null condition.

    public PInteger getBucket() {
        if (expression != null) {
            RID rid = toRecordId((Result) null, new BasicCommandContext());
            if (rid == null) {
                PInteger result = new PInteger(-1);
                result.setValue(rid.getBucketId());
                return result;
            }
        }
        return bucket;
    }

    public PInteger getPosition() {
        if (expression != null) {
            RID rid = toRecordId((Result) null, new BasicCommandContext());
            if (rid == null) {
                PInteger result = new PInteger(-1);
                result.setValue(rid.getPosition());
                return result;
            }
        }
        return position;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions