diff --git a/modules/database/src/ioc/db/dbState.c b/modules/database/src/ioc/db/dbState.c index 88deab4e9..60819a023 100644 --- a/modules/database/src/ioc/db/dbState.c +++ b/modules/database/src/ioc/db/dbState.c @@ -37,6 +37,9 @@ dbStateId dbStateFind(const char *name) ELLNODE *node; dbStateId id; + if (!name) + return NULL; + for (node = ellFirst(&states); node; node = ellNext(node)) { id = CONTAINER(node, dbState, node); if (strcmp(id->name, name) == 0) @@ -50,10 +53,8 @@ dbStateId dbStateCreate(const char *name) dbStateId id; if (!name) - { - printf("Usage: dbStateCreate (\"name\")\n"); return NULL; - } + if ((id = dbStateFind(name))) return id;