Commit a925ed57 authored by jan.koester's avatar jan.koester
Browse files

bugfix

parent 52ebbf0f
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -300,11 +300,6 @@ size_t confplus::Config::getElements(confplus::Config::ConfigData* key) const{
}

const std::string confplus::Config::getValue(confplus::Config::ConfigData* key, size_t pos) const{
    if(key->haveChild){
        ConfException err;
        err[ConfException::Error] << "getValue it is a path not key" << pos;
        throw err;
    }
    if(key->Elements<pos){
        ConfException err;
        err[ConfException::Error] << "getValue pos out of range !" << pos;
@@ -313,10 +308,14 @@ const std::string confplus::Config::getValue(confplus::Config::ConfigData* key,

    for(ConfigValue *cur=key->Value.get(); cur; cur=cur->_nextValue.get()){
        if(cur->_Pos==pos){
            if (cur->haveChild) {
                ConfException err;
                err[ConfException::Error] << "getValue it is a path not key" << pos;
                throw err;
            }
            return cur->_Value;
        }
    }

    return "";

}