#fixed code
                                @Override
    public int compare(@Nullable Object left, @Nullable Object right) throws SpelEvaluationException {
        if (left == null) {
            return right == null ? 0 : -1;
        } else if (right == null) {
            return 1;
        }

        try {
            BigDecimal leftValue = new BigDecimal(left.toString());
            BigDecimal rightValue = new BigDecimal(right.toString());

            return super.compare(leftValue, rightValue);
        } catch (Exception e) {

        }

        return super.compare(left, right);
    }
#vulnerable code 
                                @Override
    public int compare(@Nullable Object left, @Nullable Object right) throws SpelEvaluationException {
        if (left == null) {
            return 0;
        }

        try {
            BigDecimal leftValue = new BigDecimal(left.toString());
            BigDecimal rightValue = new BigDecimal(right.toString());

            return super.compare(leftValue, rightValue);
        } catch (Exception e) {

        }

        return super.compare(left, right);
    } 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE