File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -789,14 +789,28 @@ def process_message(self, message):
789789 self .consumer .send_message (message .response (response ))
790790
791791 def on_pause (self , msg ):
792- proc = psutil .Process (self .application_process .pid )
793- proc .suspend ()
794- self .pause_sim ()
792+ if self .application_process is not None :
793+ try :
794+ proc = psutil .Process (self .application_process .pid )
795+ proc .suspend ()
796+ self .pause_sim ()
797+ except Exception as e :
798+ LogManager .logger .exception ("Error suspending process" )
799+ else :
800+ LogManager .logger .warning ("Application process was None during pause. Calling termination." )
801+ self .on_terminate_application (msg )
795802
796803 def on_resume (self , msg ):
797- proc = psutil .Process (self .application_process .pid )
798- proc .resume ()
799- self .unpause_sim ()
804+ if self .application_process is not None :
805+ try :
806+ proc = psutil .Process (self .application_process .pid )
807+ proc .resume ()
808+ self .unpause_sim ()
809+ except Exception as e :
810+ LogManager .logger .exception ("Error suspending process" )
811+ else :
812+ LogManager .logger .warning ("Application process was None during resume. Calling termination." )
813+ self .on_terminate_application (msg )
800814
801815 def pause_sim (self ):
802816 if self .visualization_type in ["gzsim_rae" , "bt_studio_gz" ]:
You can’t perform that action at this time.
0 commit comments