Return ByteArray as "value" for FieldInfo's with type FT_NONE (which has data).

This fixes bug 5201.

svn path=/trunk/; revision=51903
This commit is contained in:
Stig Bjørlykke 2013-09-09 21:42:49 +00:00
parent 8fbfb0f4fd
commit 408b498a12
1 changed files with 6 additions and 3 deletions

View File

@ -62,9 +62,6 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
FieldInfo fi = checkFieldInfo(L,1);
switch(fi->hfinfo->type) {
case FT_NONE:
lua_pushnil(L);
return 1;
case FT_BOOLEAN:
lua_pushboolean(L,(int)fvalue_get_uinteger(&(fi->value)));
return 1;
@ -146,6 +143,12 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
return 1;
}
case FT_NONE:
if (fi->length == 0) {
lua_pushnil(L);
return 1;
}
/* FALLTHROUGH */
case FT_BYTES:
case FT_UINT_BYTES:
case FT_GUID: