diff options
author | Dan Gudmundsson <[email protected]> | 2013-11-14 15:34:55 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-01-27 16:13:57 +0100 |
commit | cf20035dc7a4fbab47ce17b99b674e4db5eb7a07 (patch) | |
tree | 2cb48cabb34977d3f465ad38def55df70bdfe509 /lib/observer/src/observer_app_wx.erl | |
parent | bfae535d4ac51d2c3bef146e0f058e105bb5e956 (diff) | |
download | otp-cf20035dc7a4fbab47ce17b99b674e4db5eb7a07.tar.gz otp-cf20035dc7a4fbab47ce17b99b674e4db5eb7a07.tar.bz2 otp-cf20035dc7a4fbab47ce17b99b674e4db5eb7a07.zip |
observer: Fix memory and scheduler info and handle missing fields
Fix app viewer crash
Diffstat (limited to 'lib/observer/src/observer_app_wx.erl')
-rw-r--r-- | lib/observer/src/observer_app_wx.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl index 82395fbe08..a710bd0a69 100644 --- a/lib/observer/src/observer_app_wx.erl +++ b/lib/observer/src/observer_app_wx.erl @@ -178,11 +178,16 @@ handle_event(#wx{id=Id, event=_Sz=#wxSize{size=Size}}, {noreply, State}; handle_event(#wx{event=#wxMouse{type=Type, x=X0, y=Y0}}, - S0=#state{app=#app{ptree=Tree}, app_w=AppWin}) -> - {X,Y} = wxScrolledWindow:calcUnscrolledPosition(AppWin, X0, Y0), - Hit = locate_node(X,Y, [Tree]), - State = handle_mouse_click(Hit, Type, S0), - {noreply, State}; + S0=#state{app=App, app_w=AppWin}) -> + case App of + #app{ptree=Tree} -> + {X,Y} = wxScrolledWindow:calcUnscrolledPosition(AppWin, X0, Y0), + Hit = locate_node(X,Y, [Tree]), + State = handle_mouse_click(Hit, Type, S0), + {noreply, State}; + _ -> + {noreply, S0} + end; handle_event(#wx{event=#wxCommand{type=command_menu_selected}}, State = #state{sel=undefined}) -> |