Skip to content

Commit

Permalink
Fixing an exception caused when an improper blueprint path is added t…
Browse files Browse the repository at this point in the history
…o the engrams.
  • Loading branch information
thommcgrath committed Dec 14, 2017
1 parent b64beac commit 0c5760e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Project/Modules/Beacon/Engram.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ Protected Class Engram
End If

Dim Idx As Integer = Self.mPath.IndexOf(6, "/")
If Idx = -1 Then
Return "Unknown"
End If
Dim Name As Text = Self.mPath.Mid(6, Idx - 6)
Select Case Name
Case "PrimalEarth"
Expand All @@ -139,6 +142,9 @@ Protected Class Engram
Case "Mods"
Dim StartAt As Integer = Idx + 1
Dim EndAt As Integer = Self.mPath.IndexOf(StartAt, "/")
If EndAt = -1 Then
EndAt = Self.mPath.Length
End If
Return Self.MakeHumanReadableText(Self.mPath.Mid(StartAt, EndAt - StartAt))
Else
Return Self.MakeHumanReadableText(Name)
Expand Down

0 comments on commit 0c5760e

Please sign in to comment.