Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix startTime error on Android 9 with Chrome 74 (#67391)
### What? Fixes the error `Cannot read property 'startTime' of null` on Chrome 74 for Android 9 by ensuring the `beforeHydrationMeasure` and `hydrationMeasure` are not falsy values before accessing their properties. <img width="1164" alt="Screenshot 2024-07-02 at 11 14 53 PM" src="https://github.com/vercel/next.js/assets/52588326/34df95b6-a4fe-4886-96b8-a3c873a2ae6a"> ### Why? The application crashes on Chrome 74 for Android 9 due to `null` or other falsy values being returned in certain situations. This fix ensures that the `startTime` property is only accessed if it is not a falsy value, thereby preventing the crash. ### How? Added a falsy check before accessing the `startTime` property in the performance measurement logic. Specifically, modified the code at [this location](https://github.com/vercel/next.js/blob/b9bd23baec14508400c502b3651f4cf2497e883b/packages/next/src/client/index.tsx#L498) Co-authored-by: JJ Kasper <jj@jjsweb.site>
- Loading branch information