mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-16 08:29:54 +08:00
Adding check for null ref before accessing array index (#1116)
* Adding check for null ref before accessing array index * Adding log for missing jsCodeLocation setting
This commit is contained in:
@@ -39,7 +39,13 @@ module.exports = () => {
|
||||
}
|
||||
|
||||
// 2. Modify jsCodeLocation value assignment
|
||||
var oldJsCodeLocationAssignmentStatement = appDelegateContents.match(/(jsCodeLocation = .*)/)[1];
|
||||
var jsCodeLocations = appDelegateContents.match(/(jsCodeLocation = .*)/);
|
||||
var oldJsCodeLocationAssignmentStatement;
|
||||
if (jsCodeLocations) {
|
||||
oldJsCodeLocationAssignmentStatement = jsCodeLocations[1];
|
||||
} else {
|
||||
console.log('Couldn\'t find jsCodeLocation setting in AppDelegate.');
|
||||
}
|
||||
var newJsCodeLocationAssignmentStatement = "jsCodeLocation = [CodePush bundleURL];";
|
||||
if (~appDelegateContents.indexOf(newJsCodeLocationAssignmentStatement)) {
|
||||
console.log(`"jsCodeLocation" already pointing to "[CodePush bundleURL]".`);
|
||||
|
||||
Reference in New Issue
Block a user