Skip to content

Commit 8c85448

Browse files
author
Colin Yang
committed
Back - Fixed manage-settigns api returns empty string when no settings key in db
1 parent 71595f7 commit 8c85448

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/class/api/Manage.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ private static function saltPassword($pwd) {
2929
}
3030

3131
private static function settings() {
32-
return json_decode(DbProvider::getDb()->getReserved(DbBase::$KEY_MANAGE_SETTINGS), true);
32+
$settings = json_decode(DbProvider::getDb()->getReserved(DbBase::$KEY_MANAGE_SETTINGS), true);
33+
return $settings === '' ? new stdClass : $settings;
3334
}
3435
private static function updateSetting($settingId, $value) {
3536
$settings = self::settings();

0 commit comments

Comments
 (0)