Fix Uncaught TypeError: Cannot read property 'length' of null

https://app.getsentry.com/id/id/group/5208581/