@@ -209,16 +209,17 @@ export class AuroraDash extends Dash {
209209 }
210210
211211 private _syncLabelFlushMode ( ) : void {
212- const items : any [ ] = [
213- ...( ( this as any ) . _box ?. get_children ?.( ) ?? [ ] ) ,
214- ( this as any ) . _showAppsIcon ,
215- ] ;
212+ const items : any [ ] = [ ...this . _getDashChildren ( ) , ( this as any ) . _showAppsIcon ] ;
216213 for ( const item of items ) {
217- if ( ! item ?. label ) continue ;
218- if ( this . _flushMode ) {
219- item . label . add_style_class_name ( 'flush-mode' ) ;
220- } else {
221- item . label . remove_style_class_name ( 'flush-mode' ) ;
214+ try {
215+ if ( ! item ?. label ) continue ;
216+ if ( this . _flushMode ) {
217+ item . label . add_style_class_name ( 'flush-mode' ) ;
218+ } else {
219+ item . label . remove_style_class_name ( 'flush-mode' ) ;
220+ }
221+ } catch {
222+ // Ignore children disposed during shell shutdown.
222223 }
223224 }
224225 }
@@ -340,10 +341,15 @@ export class AuroraDash extends Dash {
340341
341342 private _isMenuOpen ( ) : boolean {
342343 const dashAny = this as any ;
343- const children = dashAny . _box ?. get_children ?. ( ) ?? [ ] ;
344+ const children = this . _getDashChildren ( ) ;
344345
345346 for ( const child of children ) {
346- const appIcon = child . child ?. _delegate ;
347+ let appIcon : any ;
348+ try {
349+ appIcon = child . child ?. _delegate ;
350+ } catch {
351+ continue ;
352+ }
347353
348354 if ( appIcon ?. _menu ?. isOpen ) {
349355 return true ;
@@ -499,11 +505,15 @@ export class AuroraDash extends Dash {
499505 // Snapshot existing (non-animating-out) apps so we can detect newly added
500506 // items after stock _redisplay and animate them in ourselves.
501507 const isFirstDisplay = ! dashAny . _shownInitially ;
502- const existingApps = new Set < any > (
503- ( ( this as any ) . _box ?. get_children ?.( ) ?? [ ] )
504- . filter ( ( c : any ) => c . child ?. _delegate ?. app && ! c . animatingOut )
505- . map ( ( c : any ) => c . child . _delegate . app ) ,
506- ) ;
508+ const existingApps = new Set < any > ( ) ;
509+ for ( const child of this . _getDashChildren ( ) ) {
510+ try {
511+ const app = child . child ?. _delegate ?. app ;
512+ if ( app && ! child . animatingOut ) existingApps . add ( app ) ;
513+ } catch {
514+ // Ignore children disposed during shell shutdown.
515+ }
516+ }
507517
508518 // Temporarily patch get_running() so the base Dash only sees apps with
509519 // windows on this monitor and active workspace. _globallyRunningIds is set
@@ -557,21 +567,24 @@ export class AuroraDash extends Dash {
557567 // (instant) when overview.visible is false, leaving new items at scale=1.
558568 // We detect them via the pre-redisplay snapshot and replay the animation.
559569 if ( shouldAnimate && ! isFirstDisplay ) {
560- const children = ( this as any ) . _box ?. get_children ?.( ) ?? [ ] ;
561- for ( const child of children ) {
562- const childApp = child . child ?. _delegate ?. app ;
563- if ( childApp && ! existingApps . has ( childApp ) && ! child . animatingOut ) {
564- child . remove_all_transitions ( ) ;
565- child . scale_x = 0 ;
566- child . scale_y = 0 ;
567- child . opacity = 0 ;
568- child . ease ( {
569- scale_x : 1 ,
570- scale_y : 1 ,
571- opacity : 255 ,
572- duration : ANIMATION_TIME ,
573- mode : Clutter . AnimationMode . EASE_OUT_QUAD ,
574- } ) ;
570+ for ( const child of this . _getDashChildren ( ) ) {
571+ try {
572+ const childApp = child . child ?. _delegate ?. app ;
573+ if ( childApp && ! existingApps . has ( childApp ) && ! child . animatingOut ) {
574+ child . remove_all_transitions ( ) ;
575+ child . scale_x = 0 ;
576+ child . scale_y = 0 ;
577+ child . opacity = 0 ;
578+ child . ease ( {
579+ scale_x : 1 ,
580+ scale_y : 1 ,
581+ opacity : 255 ,
582+ duration : ANIMATION_TIME ,
583+ mode : Clutter . AnimationMode . EASE_OUT_QUAD ,
584+ } ) ;
585+ }
586+ } catch {
587+ // Ignore children disposed during shell shutdown.
575588 }
576589 }
577590 }
@@ -605,13 +618,16 @@ export class AuroraDash extends Dash {
605618 }
606619
607620 private _updatePerMonitorRunningDots ( ) : void {
608- const children = ( this as any ) . _box ?. get_children ?.( ) ?? [ ] ;
609- for ( const child of children ) {
610- const icon = child . child ?. _delegate ;
611- if ( ! icon ?. app ) continue ;
612- const hasWindowHere = icon . app . get_windows ( ) . some ( ( w : any ) => this . _isWindowRelevant ( w ) ) ;
613- const dot = icon . _dot ;
614- if ( dot ) dot . visible = hasWindowHere ;
621+ for ( const child of this . _getDashChildren ( ) ) {
622+ try {
623+ const icon = child . child ?. _delegate ;
624+ if ( ! icon ?. app ) continue ;
625+ const hasWindowHere = icon . app . get_windows ( ) . some ( ( w : any ) => this . _isWindowRelevant ( w ) ) ;
626+ const dot = icon . _dot ;
627+ if ( dot ) dot . visible = hasWindowHere ;
628+ } catch {
629+ // Ignore children disposed during shell shutdown.
630+ }
615631 }
616632 }
617633
@@ -625,9 +641,13 @@ export class AuroraDash extends Dash {
625641 * clicked a window directly or switched apps).
626642 */
627643 private _overrideIconActivation ( ) : void {
628- const children = ( this as any ) . _box ?. get_children ?.( ) ?? [ ] ;
629- for ( const child of children ) {
630- const appIcon = child . child ?. _delegate ;
644+ for ( const child of this . _getDashChildren ( ) ) {
645+ let appIcon : any ;
646+ try {
647+ appIcon = child . child ?. _delegate ;
648+ } catch {
649+ continue ;
650+ }
631651 if ( ! appIcon ?. app || appIcon . _auroraActivatePatched ) continue ;
632652
633653 appIcon . _auroraActivatePatched = true ;
@@ -720,6 +740,15 @@ export class AuroraDash extends Dash {
720740 }
721741 }
722742
743+ private _getDashChildren ( ) : any [ ] {
744+ if ( this . _isDestroyed ) return [ ] ;
745+ try {
746+ return ( this as any ) . _box ?. get_children ?.( ) ?? [ ] ;
747+ } catch {
748+ return [ ] ;
749+ }
750+ }
751+
723752 private _setupSpringLoadMonitor ( ) : void {
724753 this . _springLoadDragMonitor = {
725754 dragMotion : ( dragEvent : any ) => {
0 commit comments