Avoid splash image failures if image is corrupt

Splash image backend would throw if the image is not a valid png during
the write step. This could prevent the device from provisioning if some
corruption happens at some point.

Change-type: patch
This commit is contained in:
Felipe Lalanne 2022-04-15 20:03:40 +00:00
parent cbd74954b3
commit a5ede01b18

View File

@ -84,7 +84,9 @@ export class SplashImage extends ConfigBackend {
// Write the buffer to the given location
await hostUtils.writeToBoot(where, buffer);
} else {
throw new Error('Splash image should be a base64 encoded PNG image');
log.error(
'Expected splash image to be a base64 encoded PNG image. Skipping write.',
);
}
}