Fix undefined image from DriveCompatibilityWarning

Fixes: #3160
Change-type: patch
Changelog-entry: Fix undefined image from DriveCompatibilityWarning
This commit is contained in:
Rob Evans 2020-05-20 21:06:54 +01:00 committed by Lorenzo Alberto Maria Ambrosi
parent c25db503e0
commit 31bd8ce7ae

View File

@ -59,6 +59,7 @@ export interface Image {
* containing the image. * containing the image.
*/ */
export function isSourceDrive(drive: DrivelistDrive, image: Image): boolean { export function isSourceDrive(drive: DrivelistDrive, image: Image): boolean {
image = image || {};
for (const mountpoint of drive.mountpoints || []) { for (const mountpoint of drive.mountpoints || []) {
if (image.path !== undefined && pathIsInside(image.path, mountpoint.path)) { if (image.path !== undefined && pathIsInside(image.path, mountpoint.path)) {
return true; return true;
@ -164,7 +165,7 @@ export const COMPATIBILITY_STATUS_TYPES = {
*/ */
export function getDriveImageCompatibilityStatuses( export function getDriveImageCompatibilityStatuses(
drive: DrivelistDrive, drive: DrivelistDrive,
image: Image, image: Image = {},
) { ) {
const statusList = []; const statusList = [];