Skip to content
Merged

5.61.1 #2406

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebotv5",
"version": "5.61.0",
"version": "5.61.1",
"description": "Powerful all-in-one bot for Twitch streamers.",
"main": "build/main.js",
"scripts": {
Expand Down
12 changes: 9 additions & 3 deletions src/backend/common/profile-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,17 @@ const getJsonDbInProfile = function(filepath, humanReadable = true) {
const jsonDbPath = getPathInProfile(filepath);

try {
return new JsonDB(jsonDbPath, true, humanReadable);
const db = new JsonDB(jsonDbPath, true, humanReadable);
db.load();
return db;
} catch (error) {
logger.error(`Error loading JsonDB at ${filepath}. Attempting to recreate.`, error);
logger.error(`Error loading JsonDB at ${jsonDbPath}. Attempting to recreate.`);

const fullPath = jsonDbPath.toLowerCase().endsWith(".json")
? jsonDbPath
: `${jsonDbPath}.json`;

fs.rmSync(jsonDbPath, { force: true });
fs.rmSync(fullPath, { force: true });

return new JsonDB(jsonDbPath, true, humanReadable);
}
Expand Down