#vulnerable code 
                                @Override
    public Collection<?> getSortableContainerPropertyIds() {
        if (backingList instanceof SortableLazyList) {
            // Assume SortableLazyList can sort by any Comparable property
        } else if (backingList instanceof LazyList) {
            // When using LazyList, don't support sorting by default
            // as the sorting should most probably be done at backend call level
            return Collections.emptySet();
        }
        final ArrayList<String> props = new ArrayList<String>();
        for (Object a : getContainerPropertyIds()) {
            DynaProperty db = getDynaClass().getDynaProperty(a.toString());
            if (db != null && db.getType() != null && (db.getType().
                    isPrimitive() || Comparable.class.isAssignableFrom(
                            db.getType()))) {
                props.add(db.getName());
            }
        }
        return props;
    } 
                            #location 12 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public Collection<?> getSortableContainerPropertyIds() {
        if (backingList instanceof SortableLazyList) {
            // Assume SortableLazyList can sort by any Comparable property
        } else if (backingList instanceof LazyList) {
            // When using LazyList, don't support sorting by default
            // as the sorting should most probably be done at backend call level
            return Collections.emptySet();
        }
        final ArrayList<String> props = new ArrayList<String>();
        for (Object a : getContainerPropertyIds()) {
            String propName = a.toString();
            Class<?> propType = getType(propName);
            if (propType != null && (propType.isPrimitive() || Comparable.class.isAssignableFrom(propType))) {
                props.add(propName);
            }
        }
        return props;
    }