Game Development Community

SimFieldDictionary::setFieldValue and null values?

by Gregory "Centove" McLean · in Torque Game Engine · 06/07/2004 (9:28 am) · 0 replies

I've been working with this resource: (ODBC Interface)
--
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2737

And for the most part it works, however when I query an empty table (no rows yet) It causes a crash of the server.

I'm working with Linux, I've traced it down to this:

Program received signal SIGSEGV, Segmentation fault.
0x0808a353 in SimFieldDictionary::setFieldValue(char const*, char const*) (
this=0x408f4738, slotName=0x4064ec84 "UserID", value=0x0)
at console/simBase.cc:142
142 if(!*value)

So it looks like if that setFieldValue gets a value it blows up?

Dunno if this is a bug or not?

However changing that if (!*value) to just if (!value) and the segfault goes away.
-- Edit
I found the root cause of the null pointer getting to the simbase I fixed that and the fault went away as well.. Still it seems that the simbase should deal with NULL pointers a bit better?