Skip to content

Commit ef35b76

Browse files
committed
Commands/CalcLaplacian: handle missing incidence matrix.
1 parent 4d366c1 commit ef35b76

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
- Alt/CE: Fix `RegisterValues` in the C header.
2323
- Alt/PDE: Check for missing solution in a few functions.
24+
- Commands/`CalcLaplacian`: Give proper error message instead of crashing or giving "access violation" messages.
2425

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

src/Executive/ExecCommands.pas

+5
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ procedure ProcessCommand({$IFDEF DSS_CAPI_PM}MainDSS{$ELSE}DSS{$ENDIF}: TDSSCont
420420
{$ENDIF}
421421
ord(Cmd.CalcLaplacian):
422422
begin
423+
if DSS.ActiveCircuit.Solution.IncMat = NIL then
424+
begin
425+
DoSimpleMsg(DSS, _('Indidence matrix is not present. Please run either "CalcIncMatrix" or "CalcIncMatrix_O" first.'), 8877);
426+
Exit;
427+
end;
423428
with DSS.ActiveCircuit.Solution do
424429
begin
425430
Laplacian := IncMat.Transpose(); // Transposes the Incidence Matrix

0 commit comments

Comments
 (0)