Skip to content

Commit 56a0f1f

Browse files
minhtcpatniko
authored andcommitted
Remove attribute which is ‘function’ before convert to native type, fix EXC_BAD_ACCESS error iOS (#809)
1 parent 2cd2ef0 commit 56a0f1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

package-mixins.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ module.exports = (NativeCodePush) => {
2626
// Use the downloaded package info. Native code will save the package info
2727
// so that the client knows what the current package version is.
2828
try {
29-
const downloadedPackage = await NativeCodePush.downloadUpdate(this, !!downloadProgressCallback);
29+
const updatePackageCopy = Object.assign({}, this);
30+
Object.keys(updatePackageCopy).forEach((key) => (typeof updatePackageCopy[key] === 'function') && delete updatePackageCopy[key]);
31+
32+
const downloadedPackage = await NativeCodePush.downloadUpdate(updatePackageCopy, !!downloadProgressCallback);
3033
reportStatusDownload && reportStatusDownload(this);
3134
return { ...downloadedPackage, ...local };
3235
} finally {

0 commit comments

Comments
 (0)