mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
catch bad data on all importers
This commit is contained in:
@@ -190,8 +190,7 @@
|
||||
function parseData(data) {
|
||||
var folders = [],
|
||||
sites = [],
|
||||
siteRelationships = [],
|
||||
badDataSites = 0;
|
||||
siteRelationships = [];
|
||||
|
||||
angular.forEach(data, function (value, key) {
|
||||
var folderIndex = folders.length,
|
||||
@@ -209,10 +208,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ((!value.name || value.name === '') && (!value.password || value.password === '')) {
|
||||
badDataSites++;
|
||||
}
|
||||
|
||||
sites.push({
|
||||
favorite: value.fav === '1',
|
||||
uri: value.url && value.url !== '' ? trimUri(value.url) : null,
|
||||
@@ -237,12 +232,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
if (badDataSites && badDataSites > (data.length / 2)) {
|
||||
error('CSV data is not formatted correctly from LastPass. Please check your import file and try again.');
|
||||
}
|
||||
else {
|
||||
success(folders, sites, siteRelationships);
|
||||
}
|
||||
success(folders, sites, siteRelationships);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user