@@ -499,20 +499,23 @@ function getWallpaper() {
499499}
500500
501501Dialog . prototype . injectMica = function ( ) {
502- if ( this . micaElement ) return ;
503- var wallpaper = document . getElementById ( "wallpaper" ) ;
504- var image = wallpaper . children [ 0 ] . cloneNode ( true ) ;
505- if ( image instanceof HTMLImageElement ) {
506- var blurredUrl = image . getAttribute ( "blurred-src" ) ;
507- if ( blurredUrl ) {
508- console . log ( "Found blurred version: " + blurredUrl ) ;
509- image . src = blurredUrl ;
502+ try {
503+ if ( this . micaElement ) return ;
504+ var wallpaper = document . getElementById ( "wallpaper" ) ;
505+ var image = wallpaper . children [ 0 ] . cloneNode ( true ) ;
506+ if ( image instanceof HTMLImageElement ) {
507+ var blurredUrl = image . getAttribute ( "blurred-src" ) ;
508+ if ( blurredUrl ) {
509+ console . log ( "Found blurred version: " + blurredUrl ) ;
510+ image . src = blurredUrl ;
511+ }
510512 }
511- }
512- var clip = this . target . getElementsByClassName ( "backdrop-clip" ) [ 0 ] ;
513- image . classList . add ( "mica" ) ;
514- clip . appendChild ( image ) ;
515- this . move ( this . x , this . y ) ;
513+ var clip = this . target . getElementsByClassName ( "backdrop-clip" ) [ 0 ] ;
514+ if ( ! clip ) return ;
515+ image . classList . add ( "mica" ) ;
516+ clip . appendChild ( image ) ;
517+ this . move ( this . x , this . y ) ;
518+ } catch ( ex ) { console . warn ( ex ) ; }
516519}
517520
518521/**
0 commit comments