lua_pushstring (cbd->L, error_str);
if (cbd->ctx) {
- lua_pushstring (cbd->L, res->domain);
- lua_pushstring (cbd->L, res->selector);
- lua_pushstring (cbd->L, res->short_b);
- lua_pushstring (cbd->L, res->fail_reason);
+ if (res->domain) {
+ lua_pushstring (cbd->L, res->domain);
+ }
+ else {
+ lua_pushnil (cbd->L);
+ }
+
+ if (res->selector) {
+ lua_pushstring (cbd->L, res->selector);
+ }
+ else {
+ lua_pushnil (cbd->L);
+ }
+
+ if (res->short_b) {
+ lua_pushstring (cbd->L, res->short_b);
+ }
+ else {
+ lua_pushnil (cbd->L);
+ }
+
+ if (res->fail_reason) {
+ lua_pushstring (cbd->L, res->fail_reason);
+ }
+ else {
+ lua_pushnil (cbd->L);
+ }
}
else {
lua_pushnil (cbd->L);