Skip to content

Commit 3f537f1

Browse files
riteshshukla04Ritesh Shukla2
andauthored
fix: don't crash if codegenConfig is not defined in package.json (#716)
This will prevent undefined from being thrown as error and actual error will be thrown. #713 Co-authored-by: Ritesh Shukla2 <[email protected]>
1 parent a0ca7d2 commit 3f537f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native-builder-bob/src/utils/patchCodegenAndroidPackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function patchCodegenAndroidPackage(
2020
report: Report
2121
) {
2222
let codegenAndroidPath: string | undefined =
23-
packageJson.codegenConfig.outputDir.android;
23+
packageJson.codegenConfig?.outputDir?.android;
2424
if (!codegenAndroidPath) {
2525
throw new Error(
2626
`Your package.json doesn't contain codegenConfig.outputDir.android. Please see ${CODEGEN_DOCS}`

0 commit comments

Comments
 (0)