Skip to content
Merged
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: 3 additions & 1 deletion addons/gamepad/userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default async function ({ addon, console, msg }) {
console.warn("Could not export gamepad settings");
return;
}
const existingComment = findOptionsComment();
let existingComment = findOptionsComment();
if (existingComment) {
const parsedExistingSettingsMap = parseOptionsComment(existingComment);
if (parsedExistingSettingsMap) {
Expand All @@ -205,6 +205,8 @@ export default async function ({ addon, console, msg }) {
const mergedMap = new Map([...parsedExistingSettingsMap, ...exportedSettingsMap]);
existingComment.text = formatMapAsComment(mergedMap);
} else {
// In case of corrupted settings, remove the bad comment (a new one will be created below)
removeStoredMappings();
existingComment = null;
}
}
Expand Down
Loading