File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ window.cls.Client = function()
8686 var tmpl = window . templates . remote_debug_settings ( port + 1 ) ;
8787 remote_debug_setting . clearAndRender ( tmpl ) ;
8888 }
89-
90- UI . get_instance ( ) . get_button ( "toggle-remote-debug-overlay" )
91- . addClass ( "alert" ) ;
89+ var button = UI . get_instance ( ) . get_button ( "toggle-remote-debug-overlay" ) ;
90+ if ( button )
91+ button . addClass ( "alert" ) ;
9292
9393 Overlay . get_instance ( ) . set_info_content (
9494 [ "p" , ui_strings . S_INFO_ERROR_LISTENING . replace ( / % s / , port ) ]
@@ -372,13 +372,12 @@ window.cls.Client = function()
372372 window . messages . post ( "window-controls-created" , { window_controls : win_ctrls } ) ;
373373
374374 var button = UI . get_instance ( ) . get_button ( "toggle-remote-debug-overlay" ) ;
375- if ( this . current_client && this . connection_is_remote ( this . current_client ) )
375+ if ( button )
376376 {
377- button . addClass ( "remote-active" ) ;
378- }
379- else
380- {
381- button . removeClass ( "remote-active" ) ;
377+ if ( this . current_client && this . connection_is_remote ( this . current_client ) )
378+ button . addClass ( "remote-active" ) ;
379+ else
380+ button . removeClass ( "remote-active" ) ;
382381 }
383382 } ;
384383
Original file line number Diff line number Diff line change 266266
267267 if ( overlay_id == "remote-debug-overlay" && ( ! client || ! client . connected ) )
268268 {
269- UI . get_instance ( ) . get_button ( "toggle-remote-debug-overlay" )
270- . removeClass ( "alert" ) ;
269+ var button = UI . get_instance ( ) . get_button ( "toggle-remote-debug-overlay" ) ;
270+ if ( button )
271+ button . removeClass ( "alert" ) ;
271272 eventHandlers . click [ 'cancel-remote-debug' ] ( ) ; // TODO: make a proper action
272273 }
273274
You can’t perform that action at this time.
0 commit comments