don't fail when null objects are present in d3sketch format

there shouldn’t be null objects
This commit is contained in:
Casper Lamboo 2018-02-21 11:21:35 +01:00
parent b9ed59c8d9
commit eb19034e86

View File

@ -28,6 +28,9 @@ export function reviveObject(objects, reviver) {
} }
function revive(appVersion, key, value) { function revive(appVersion, key, value) {
// Somtimes there are null objects in the d3sketchformat (when saving fails)
if (!value) return value;
if (semver.lt(appVersion, '0.1.2')) { if (semver.lt(appVersion, '0.1.2')) {
if (key === 'imageData') { if (key === 'imageData') {
return base64ToImage(value); return base64ToImage(value);