Skip to content

Commit

Permalink
API: check if there's a circuit for Circuit_Save.
Browse files Browse the repository at this point in the history
  • Loading branch information
PMeira committed Feb 21, 2024
1 parent ef35b76 commit d8710bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Alt/CE: Fix `RegisterValues` in the C header.
- Alt/PDE: Check for missing solution in a few functions.
- Commands/`CalcLaplacian`: Give proper error message instead of crashing or giving "access violation" messages.
- `Circuit_Save`: check if there is circuit to save.

## Version 0.14.1 (2024-02-16)

Expand Down
2 changes: 2 additions & 0 deletions src/CAPI/CAPI_Circuit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,8 @@ function Circuit_Save(dirfilepath: PAnsiChar; saveFlags: DSSSaveFlags): PAnsiCha
begin
res := '';
Result := NIL;
if InvalidCircuit(DSSPrime) then
Exit;
if DSSPrime.ActiveCircuit.Save(dirfilepath, @saveFlags, @res) then
Result := DSS_GetAsPAnsiChar(DSSPrime, res);
end;
Expand Down

0 comments on commit d8710bf

Please sign in to comment.