Fix crash when browser doesn't report page change measurement
This commit is contained in:
parent
6bf1eb105a
commit
22f2d6f292
2 changed files with 10 additions and 3 deletions
|
@ -413,6 +413,10 @@ export default React.createClass({
|
|||
performance.clearMarks('riot_MatrixChat_page_change_start');
|
||||
performance.clearMarks('riot_MatrixChat_page_change_stop');
|
||||
const measurement = performance.getEntriesByName('riot_MatrixChat_page_change_delta').pop();
|
||||
|
||||
// In practice, sometimes the entries list is empty, so we get no measurement
|
||||
if (!measurement) return null;
|
||||
|
||||
return measurement.duration;
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue