not-trac
not-trac copied to clipboard
Error when uploading an attachment
I got the following error while trying to upload an attachment. I was using the kanban-ish branch at the time.
Two issues with errors of this nature:
- The attachment didn't upload at all, so that's obviously not how it's supposed to work.
- I had a comment drafted in the ticket view at the time, and there was no way to recover that message once the error occurred. Probably something worth exploring in a separate ticket, but wanted to mention.
====
TypeError: Cannot read property '1' of null
TicketChanges.getChange – src/components/TicketChanges.js:86
83 | let description = attachments && patch in attachments && attachments[ patch ].description;
84 | let pullLink = null;
85 | if ( description && description.indexOf( 'https://github.com/WordPress/wordpress-develop/pull/' ) ) {
> 86 | pullLink = description.match( /(https:\/\/github.com\/WordPress\/wordpress-develop\/pull\/\d+)/i )[ 1 ];
87 | description = description.replace(
88 | /\(From (https:\/\/github.com\/WordPress\/wordpress-develop\/pull\/\d+)\)/,
89 | ''
Ah dang, looks like @joehoyle beat me to this one in e39a61bd. Needs to be applied to the kanban-ish branch.
@joemcgill This should be fixed now?