I don't see what your code would fix or change, other than creating an extra variable. It also changes the program behaviour, because now the variable created in if let index is never used.
I should also specify that I was never able to reproduce this crash myself.
Topic:
Programming Languages
SubTopic:
Swift
Tags: