polyamspace / mastodon

Custom Mastodon fork used by https://polyam.space
GNU Affero General Public License v3.0
1 stars 2 forks source link

Don't rely on capture group in version check regex #592

Closed polyamAdmin closed 3 weeks ago

polyamAdmin commented 3 weeks ago

Follow-up to #590

When the version strings are in an unexpected format, the match is nil, which throws an NoMethodError, when trying to access the capture group.

This changes the regex to not rely on a capture group, which results in an empty string instead when nothing is matched.

This isn't ideal either, but far better than the current behavior.