afb-api-ws: Fix bug introduced by 2e83db0
[src/app-framework-binder.git] / src / afb-api-ws.c
index 07c8202..0022d52 100644 (file)
@@ -324,6 +324,12 @@ int afb_api_ws_add_server(const char *path, struct afb_apiset *apiset)
        if (apiws == NULL)
                goto error;
 
+       /* check api name */
+       if (!afb_apiset_lookup(apiset, apiws->api, 1)) {
+               ERROR("Can't provide ws-server for %s: API %s doesn't exist", path, apiws->api);
+               goto error2;
+       }
+
        /* connect for serving */
        rc = api_ws_server_connect(apiws);
        if (rc < 0)