From cf20035dc7a4fbab47ce17b99b674e4db5eb7a07 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 14 Nov 2013 15:34:55 +0100 Subject: observer: Fix memory and scheduler info and handle missing fields Fix app viewer crash --- lib/observer/src/observer_app_wx.erl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/observer/src/observer_app_wx.erl') 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}) -> -- cgit v1.2.3