fix sanity checks for uci.set to be able to create new sections
[project/uci.git] / lua / uci.c
index 7f4ba99..5891562 100644 (file)
--- a/lua/uci.c
+++ b/lua/uci.c
@@ -440,7 +440,7 @@ uci_lua_set(lua_State *L)
        if (err)
                goto error;
 
-       if ((ptr.s == NULL) || (ptr.value == NULL)) {
+       if (((ptr.s == NULL) && (ptr.option != NULL)) || (ptr.value == NULL)) {
                err = UCI_ERR_INVAL;
                goto error;
        }