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