diff --git a/plugins/lua/lua-idmef.c b/plugins/lua/lua-idmef.c
index ebde74a..09e82c9 100644
--- a/plugins/lua/lua-idmef.c
+++ b/plugins/lua/lua-idmef.c
@@ -320,8 +320,10 @@ static int IDMEF_getraw(lua_State *lstate)
return -1;
}
- if ( ret == 0 )
- return 0;
+ if ( ret == 0 ) {
+ lua_pushnil(lstate);
+ return 1;
+ }
pushIDMEFValue(lstate, value);
return 1;