Skip to content

Commit d8710bf

Browse files
committed
API: check if there's a circuit for Circuit_Save.
1 parent ef35b76 commit d8710bf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

docs/changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Alt/CE: Fix `RegisterValues` in the C header.
2323
- Alt/PDE: Check for missing solution in a few functions.
2424
- Commands/`CalcLaplacian`: Give proper error message instead of crashing or giving "access violation" messages.
25+
- `Circuit_Save`: check if there is circuit to save.
2526

2627
## Version 0.14.1 (2024-02-16)
2728

src/CAPI/CAPI_Circuit.pas

+2
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,8 @@ function Circuit_Save(dirfilepath: PAnsiChar; saveFlags: DSSSaveFlags): PAnsiCha
11431143
begin
11441144
res := '';
11451145
Result := NIL;
1146+
if InvalidCircuit(DSSPrime) then
1147+
Exit;
11461148
if DSSPrime.ActiveCircuit.Save(dirfilepath, @saveFlags, @res) then
11471149
Result := DSS_GetAsPAnsiChar(DSSPrime, res);
11481150
end;

0 commit comments

Comments
 (0)