Permalink
Browse files

correct handling of empty structs in _next_ function

  • Loading branch information...
1 parent f16dd00 commit 9b9f1aed7c7ba121565202717ca5e66ee3911537 @boucman boucman committed Mar 11, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/lautoc_struct.c
View
4 src/lautoc_struct.c
@@ -159,6 +159,10 @@ const char* luaA_struct_next_member_name_typeid(lua_State* L, luaA_Type type, co
struct_entry* se = luaA_hashtable_get(struct_table, luaA_type_name(type));
if (se != NULL) {
+ if( se->num_members == 0) {
+ return NULL;
+ }
+
if(member == NULL && se->num_members > 0) {
return se->members[0]->name;
}

0 comments on commit 9b9f1ae

Please sign in to comment.