Bug 586555 - groupItemStorageSanity: if it's a check, let's really check it! r=tim

This commit is contained in:
Raymond Lee 2011-08-04 23:40:10 +08:00
parent 8c09fbac55
commit 84cbe40194

View File

@ -2233,12 +2233,14 @@ let GroupItems = {
// Function: groupItemStorageSanity
// Given persistent storage data for a groupItem, returns true if it appears to not be damaged.
groupItemStorageSanity: function GroupItems_groupItemStorageSanity(groupItemData) {
// TODO: check everything
// Bug 586555
var sane = true;
if (!Utils.isRect(groupItemData.bounds)) {
let sane = true;
if (!groupItemData.bounds || !Utils.isRect(groupItemData.bounds)) {
Utils.log('GroupItems.groupItemStorageSanity: bad bounds', groupItemData.bounds);
sane = false;
} else if ((groupItemData.userSize &&
!Utils.isPoint(groupItemData.userSize)) ||
!groupItemData.id) {
sane = false;
}
return sane;