~jpgleeson/spawsh

4499527f4eddb9c52034b7a874f8b3235f624738 — Jack Gleeson 7 months ago 923f6ea
FIX: No space between => and the link text sometimes caused a crash.

Encapsulating the split at space between link markup and the link reference in a try block fixes the crash.
1 files changed, 22 insertions(+), 6 deletions(-)

M Program.cs
M Program.cs => Program.cs +22 -6
@@ 299,18 299,34 @@ namespace spawsh
                        {
                            biggerArray[e] = linkSet[e];
                        }
                        biggerArray[counter] = lines[i].Split(' ')[1];

                        if (biggerArray[counter].Contains('\t'))
                        string holder = null;

                        try
                        {
                            holder = lines[i].Split(' ')[1];
                        }
                        catch
                        {
                            biggerArray[counter] = biggerArray[counter].Split('\t')[0];

                        }

                        if (!biggerArray[counter].Contains('.'))
                        if (holder != null)
                        {
                            //These should be local links
                            biggerArray[counter] = server + "/" + biggerArray[counter];
                            biggerArray[counter] = holder;

                            if (biggerArray[counter].Contains('\t'))
                            {
                                biggerArray[counter] = biggerArray[counter].Split('\t')[0];
                            }

                            if (!biggerArray[counter].Contains('.'))
                            {
                                //These should be local links
                                biggerArray[counter] = server + "/" + biggerArray[counter];
                            }
                        }
                        

                        linkSet = biggerArray;
                        counter++;