From 0aefd3341cc99191d0a2ad93556d4c0d5ff3ba11 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 14 Feb 2017 01:27:16 +0100 Subject: [PATCH] fix #122 - compile a runnable with not project opened, case of segfault --- src/ce_main.pas | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ce_main.pas b/src/ce_main.pas index 06665e9e..49ac231a 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -2518,16 +2518,19 @@ begin if fDoc.isTemporary then result := of_yes; end - else if ifInProject in fRunnablesOptions.outputFolderConditions then + else if assigned(fProject) then begin - if fProject.isSource(fDoc.fileName) then - result := of_yes; + if ifInProject in fRunnablesOptions.outputFolderConditions then + begin + if fProject.isSource(fDoc.fileName) then + result := of_yes; + end + else if ifSaved in fRunnablesOptions.outputFolderConditions then + begin + if not fProject.isSource(fDoc.fileName) and not fDoc.isTemporary then + result := of_yes; + end; end - else if ifSaved in fRunnablesOptions.outputFolderConditions then - begin - if not fProject.isSource(fDoc.fileName) and not fDoc.isTemporary then - result := of_yes; - end; end; end;