Skip to content

Commit 9542ac0

Browse files
mikeconleypchevrel@mozilla.com
authored andcommitted
Bug 1971702 - Update Opera migrator to account for the Default user profile. a=pascalc
Original Revision: https://phabricator.services.mozilla.com/D254992 Differential Revision: https://phabricator.services.mozilla.com/D255845
1 parent 9ad9599 commit 9542ac0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

browser/components/migration/ChromeProfileMigrator.sys.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,8 +1232,15 @@ export class OperaProfileMigrator extends ChromeProfileMigrator {
12321232
_keychainServiceName = "Opera Safe Storage";
12331233
_keychainAccountName = "Opera";
12341234

1235-
getSourceProfiles() {
1236-
return null;
1235+
async getSourceProfiles() {
1236+
let detectedProfiles = await super.getSourceProfiles();
1237+
if (Array.isArray(detectedProfiles) && !detectedProfiles.length) {
1238+
// We might be attempting from a version of Opera that doesn't support
1239+
// profiles yet, so try returning null to see if the profile data
1240+
// exists in the data directory.
1241+
return null;
1242+
}
1243+
return detectedProfiles;
12371244
}
12381245
}
12391246

browser/components/migration/MigratorBase.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class MigratorBase {
9393
* and not an empty array. That is the default implementation.
9494
*
9595
* @abstract
96-
* @returns {object[]|null}
96+
* @returns {Promise<object[]|null>}
9797
*/
9898
getSourceProfiles() {
9999
return null;

0 commit comments

Comments
 (0)