restore default template on saving empty code

fixes 3418ac9c
This commit is contained in:
tophf 2018-01-04 16:41:55 +03:00
parent cb3e9973bd
commit 9be2f942c7

View File

@ -62,7 +62,8 @@
} }
function save(style) { function save(style) {
if (!style.sourceCode) { // restore if stripped by getStyleWithNoCode
if (typeof style.sourceCode !== 'string') {
style.sourceCode = cachedStyles.byId.get(style.id).sourceCode; style.sourceCode = cachedStyles.byId.get(style.id).sourceCode;
} }
return buildMeta(style) return buildMeta(style)