mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
fix: check device id and creationDate for falsey values
This commit adds validation to check for falsey values in device 'id' and 'creationDate' fields in the device management component. This prevents potential issues when these string values are empty or otherwise evaluate to false. Resolves PM-18757
This commit is contained in:
@@ -180,7 +180,7 @@ export class DeviceManagementComponent {
|
|||||||
private updateDeviceTable(devices: Array<DeviceView>): void {
|
private updateDeviceTable(devices: Array<DeviceView>): void {
|
||||||
this.dataSource.data = devices
|
this.dataSource.data = devices
|
||||||
.map((device: DeviceView): DeviceTableData | null => {
|
.map((device: DeviceView): DeviceTableData | null => {
|
||||||
if (device.id == undefined) {
|
if (!device.id) {
|
||||||
this.validationService.showError(new Error(this.i18nService.t("deviceIdMissing")));
|
this.validationService.showError(new Error(this.i18nService.t("deviceIdMissing")));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ export class DeviceManagementComponent {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.creationDate == undefined) {
|
if (!device.creationDate) {
|
||||||
this.validationService.showError(
|
this.validationService.showError(
|
||||||
new Error(this.i18nService.t("deviceCreationDateMissing")),
|
new Error(this.i18nService.t("deviceCreationDateMissing")),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user