Skip to content

Commit 8adc52d

Browse files
rjackeyrjackey
authored andcommitted
fixes #47, ErrorHandling.throwError does not present a dialog if used from BaseApp
1 parent ed0bf6c commit 8adc52d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

widgets/+wt/+mixin/ErrorHandling.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef ErrorHandling < handle
22
%ErrorHandling Error handling methods
33

4-
% Copyright 2020-2021 The MathWorks Inc.
4+
% Copyright 2020-2023 The MathWorks Inc.
55

66
methods ( Access = protected )
77

@@ -24,7 +24,11 @@ function throwError(obj,err,title)
2424
end
2525

2626
% Locate ancestor figure
27-
fig = ancestor(obj,'figure');
27+
if isprop(obj,"Figure")
28+
fig = obj.Figure;
29+
else
30+
fig = ancestor(obj,'figure');
31+
end
2832

2933
% Place in a dialog if possible
3034
if ~isempty(fig)

0 commit comments

Comments
 (0)