This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch feature/refactor_bundle_cache
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/feature/refactor_bundle_cache 
by this push:
     new 4362479c Avoid unnecessary `celix_bundle_getId` and 
`httpAdmin_updateInfoSvc` in error.
4362479c is described below

commit 4362479c560278d6e826534eb5447d7de52931f0
Author: PengZheng <[email protected]>
AuthorDate: Wed Feb 22 12:33:56 2023 +0800

    Avoid unnecessary `celix_bundle_getId` and `httpAdmin_updateInfoSvc` in 
error.
---
 bundles/http_admin/http_admin/src/http_admin.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bundles/http_admin/http_admin/src/http_admin.c 
b/bundles/http_admin/http_admin/src/http_admin.c
index cd26639b..b234ad65 100755
--- a/bundles/http_admin/http_admin/src/http_admin.c
+++ b/bundles/http_admin/http_admin/src/http_admin.c
@@ -481,13 +481,13 @@ void http_admin_startBundle(void *data, const 
celix_bundle_t *bundle) {
         return;
     }
     char* bundleRoot = celix_bundle_getEntry(bundle, "");
-    if (bundleRoot != NULL) {
-        long bndId = celix_bundle_getId(bundle);
-        createAliasesSymlink(aliases, admin->root, bundleRoot, bndId, 
admin->aliasList);
-    } else {
+    if (bundleRoot == NULL) {
         celix_bundleContext_log(admin->context, CELIX_LOG_LEVEL_ERROR, "No 
root for bundle %s",
                                 celix_bundle_getSymbolicName(bundle));
+        return;
     }
+    long bndId = celix_bundle_getId(bundle);
+    createAliasesSymlink(aliases, admin->root, bundleRoot, bndId, 
admin->aliasList);
     free(bundleRoot);
     httpAdmin_updateInfoSvc(admin);
 }

Reply via email to