This post is going to be a bit more concise than it was originally going to be because I am rewriting it from scratch after losing all of my work. Apparently, Command + 2 finger swipe on Firefox on my MacBook is equivalent to pressing the back button, which is equivalent to taking nearly an hour's worth of your life and throwing it into the %#!$ing garbage...
That happened to me yesterday. Words failed me. I rewrote the post in TextEdit which doesn't throw everything away if you hit the back arrow the wrong way.
As PaulS says ...
Please note that, at present, the String library has bugs as discussed here and here.
In particular, the dynamic memory allocation used by the String class may fail and cause random crashes.
I recommend reworking your code to manage without String. Use C-style strings instead (strcpy, strcat, strcmp, etc.).