--- parser3/src/classes/table.C 2009/11/09 00:31:07 1.269 +++ parser3/src/classes/table.C 2010/05/16 22:12:50 1.271 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_TABLE_C="$Date: 2009/11/09 00:31:07 $"; +static const char * const IDENT_TABLE_C="$Date: 2010/05/16 22:12:50 $"; #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4)) #include @@ -685,7 +685,8 @@ static void table_row_to_hash(Table::ele bool exist=false; switch(info->value_type) { case C_STRING: { - exist=info->hash->put_dont_replace(*key, new VString(*row->get(info->value_fields->get(0)))); + size_t index=info->value_fields->get(0); + exist=info->hash->put_dont_replace(*key, (index < row->count()) ? new VString(*row->get(index)) : new VString()); break; } case C_HASH: { @@ -979,7 +980,7 @@ static void _flip(Request& r, MethodPara Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(0); if(size_t old_count=old_table.count()) - if(size_t old_cols=old_table[0]->count()) + if(size_t old_cols=old_table.columns()?old_table.columns()->count():old_table[0]->count()) for(size_t column=0; column