From 82006001687cd957c0375b05e0dbcd3f0e14048b Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 16 May 2018 19:07:50 +0200 Subject: [PATCH] Don't crash when opening a Gambas source file as an external file. [DEVELOPMENT ENVIRONMENT] * BUG: Don't crash when opening a Gambas source file as an external file. --- app/src/gambas3/.src/Debug/Design.module | 2 ++ app/src/gambas3/.src/Editor/Code/FEditor.class | 3 +++ 2 files changed, 5 insertions(+) diff --git a/app/src/gambas3/.src/Debug/Design.module b/app/src/gambas3/.src/Debug/Design.module index 5ace48b5f..2ce6a0e32 100644 --- a/app/src/gambas3/.src/Debug/Design.module +++ b/app/src/gambas3/.src/Debug/Design.module @@ -1371,6 +1371,8 @@ Public Sub InitEditorWithBreakpoints(hEditor As FEditor) Dim I As Integer Dim sPrefix As String + If Project.IsFake() Then Return + sPrefix = hEditor.Name & "." While I < $aBreakpoint.Count sBreakpoint = $aBreakpoint[I] diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index a65029df2..c652b4fa7 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -1041,6 +1041,7 @@ Public Function CanSetBreakpoint(iLine As Integer) As Boolean Dim sLine As String Dim iPos As Integer + If Project.IsFake() Then Return If iLine < 0 Or If iLine >= $hEditor.Count Then Return '$hEditor[iLine].Refresh @@ -1082,6 +1083,7 @@ Public Sub CheckBreakpoints() Dim iLine As Integer + If Project.IsFake() Then Return For Each iLine In $hEditor.Breakpoints If Not CanSetBreakpoint(iLine) Then SetBreakpoint(iLine, False, False) Next @@ -3350,6 +3352,7 @@ End Public Sub mnuBreakpoint_Click() + If Not CanSetBreakpoint($hEditor.Line) Then Return Design.SetBreakpoint(Me.Name & "." & CStr($hEditor.Line), Not HasBreakpoint($hEditor.Line)) End