--- parser3/src/classes/table.C 2001/08/31 09:26:12 1.108 +++ parser3/src/classes/table.C 2001/09/05 15:05:27 1.109 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: table.C,v 1.108 2001/08/31 09:26:12 parser Exp $"; +static const char *RCSId="$Id: table.C,v 1.109 2001/09/05 15:05:27 parser Exp $"; #include "classes.h" #include "pa_config_includes.h" @@ -617,16 +617,17 @@ static void _sql(Request& r, const Strin ulong limit=0; ulong offset=0; if(params->size()>1) { - Value& options_param=params->as_no_junction(1, "options must be hash, not code"); - if(Hash *options=options_param.get_hash()) { - if(Value *vlimit=(Value *)options->get(*sql_limit_name)) - limit=(ulong)r.process(*vlimit).as_double(); - if(Value *voffset=(Value *)options->get(*sql_offset_name)) - offset=(ulong)r.process(*voffset).as_double(); - } else - PTHROW(0, 0, - &method_name, - "options must be hash"); + Value& voptions=params->as_no_junction(1, "options must be hash, not code"); + if(voptions.is_defined()) + if(Hash *options=voptions.get_hash()) { + if(Value *vlimit=(Value *)options->get(*sql_limit_name)) + limit=(ulong)r.process(*vlimit).as_double(); + if(Value *voffset=(Value *)options->get(*sql_offset_name)) + offset=(ulong)r.process(*voffset).as_double(); + } else + PTHROW(0, 0, + &method_name, + "options must be hash"); } Temp_lang temp_lang(r, String::UL_SQL);