diff --git a/src/bind_faction.c b/src/bind_faction.c index 9cc6bdd97..518dddc27 100644 --- a/src/bind_faction.c +++ b/src/bind_faction.c @@ -383,7 +383,8 @@ static int tolua_faction_set_password(lua_State * L) { faction *self = (faction *)tolua_tousertype(L, 1, NULL); const char * passw = tolua_tostring(L, 2, NULL); - faction_setpassword(self, password_hash(passw, PASSWORD_DEFAULT)); + faction_setpassword(self, + passw ? password_hash(passw, PASSWORD_DEFAULT) : NULL); return 0; } diff --git a/src/kernel/faction.c b/src/kernel/faction.c index fc1de186a..238ba834b 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -564,8 +564,12 @@ const char *faction_getpassword(const faction *f) { void faction_setpassword(faction * f, const char *pwhash) { - assert(pwhash); - f->password_id = dbstring_save(pwhash); + if (pwhash) { + f->password_id = dbstring_save(pwhash); + } + else { + f->password_id = 0; + } } bool valid_race(const struct faction *f, const struct race *rc)