0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Merge pull request #1760 from ekhaled/gh-1653-followup

followup fix to #1653
This commit is contained in:
Rich Harris 2018-10-17 11:26:30 -04:00 committed by GitHub
commit 540cd05d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -831,7 +831,7 @@ export default class ElementWrapper extends Wrapper {
}
block.builders.destroy.addLine(
`if (typeof ${name}.destroy === 'function') ${name}.destroy.call(#component);`
`if (${name} && typeof ${name}.destroy === 'function') ${name}.destroy.call(#component);`
);
});
}