Skip to content

Commit

Permalink
Remove attribute which is ‘function’ before convert to native type, f…
Browse files Browse the repository at this point in the history
…ix EXC_BAD_ACCESS error iOS (#809)
  • Loading branch information
minhtc authored and patniko committed May 3, 2017
1 parent 2cd2ef0 commit 56a0f1f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package-mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = (NativeCodePush) => {
// Use the downloaded package info. Native code will save the package info
// so that the client knows what the current package version is.
try {
const downloadedPackage = await NativeCodePush.downloadUpdate(this, !!downloadProgressCallback);
const updatePackageCopy = Object.assign({}, this);
Object.keys(updatePackageCopy).forEach((key) => (typeof updatePackageCopy[key] === 'function') && delete updatePackageCopy[key]);

const downloadedPackage = await NativeCodePush.downloadUpdate(updatePackageCopy, !!downloadProgressCallback);
reportStatusDownload && reportStatusDownload(this);
return { ...downloadedPackage, ...local };
} finally {
Expand Down

0 comments on commit 56a0f1f

Please sign in to comment.