zbrateam / Zebra

🦓 A Useful Package Manager for iOS
https://getzbra.com
GNU General Public License v3.0
1.18k stars 191 forks source link

Crash when trying to add repo #1966

Closed opa334 closed 2 years ago

opa334 commented 2 years ago

Describe the bug Zebra crashes when I press the button to add a repo

To Reproduce Open Zebra Go to sources tab Press + button Crash

Expected behavior No crash

Screenshots https://twitter.com/opa334dev/status/1494806842710581248

Device Information:

Crash Log or System Log https://pastebin.com/dLVfgPzU

Additional context This worked fine earlier, now it no longer does

opa334 commented 2 years ago

https://github.com/zbrateam/Zebra/blob/master/Zebra/Tabs/Sources/Controllers/ZBSourceListTableViewController.m#L377

rangeOfFirstMatchInString returns {NSNotFound, 0} if no match is found, this is directly passed to substringWithRange and it causes the crash