1
0
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:
Alec Rippberger
2025-03-20 15:23:19 -05:00
committed by GitHub
parent 79fd1b3263
commit 87847dc806

View File

@@ -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")),
); );