Skip to content

Commit 6024d63

Browse files
committed
fix when header section not set, exit early
1 parent e6465a4 commit 6024d63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mod_pascal.pas

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ TPascalModuleCfg = record
185185
//TODO: not very performant string operation. lot of string copies.
186186
//need to improve by avoiding it
187187
headerMarkerPos := pos(LineEnding+LineEnding, compileOutput);
188+
189+
if headerMarkerPos = 0 then
190+
begin
191+
//no header found
192+
exit;
193+
end;
194+
188195
headerParts := copy(compileOutput, 1, headerMarkerPos - 1);
189196
headers := headerParts.split(LineEnding);
190197
for i:= 0 to Length(headers) - 1 do

0 commit comments

Comments
 (0)