From 31bd8ce7ae5b4b627209ece4ef850f695a2e8c25 Mon Sep 17 00:00:00 2001 From: Rob Evans Date: Wed, 20 May 2020 21:06:54 +0100 Subject: [PATCH] Fix undefined image from DriveCompatibilityWarning Fixes: #3160 Change-type: patch Changelog-entry: Fix undefined image from DriveCompatibilityWarning --- lib/shared/drive-constraints.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/shared/drive-constraints.ts b/lib/shared/drive-constraints.ts index a919c900..523e6cf3 100644 --- a/lib/shared/drive-constraints.ts +++ b/lib/shared/drive-constraints.ts @@ -59,6 +59,7 @@ export interface Image { * containing the image. */ export function isSourceDrive(drive: DrivelistDrive, image: Image): boolean { + image = image || {}; for (const mountpoint of drive.mountpoints || []) { if (image.path !== undefined && pathIsInside(image.path, mountpoint.path)) { return true; @@ -164,7 +165,7 @@ export const COMPATIBILITY_STATUS_TYPES = { */ export function getDriveImageCompatibilityStatuses( drive: DrivelistDrive, - image: Image, + image: Image = {}, ) { const statusList = [];