File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,19 @@ export class CoreIframeComponent implements OnChanges {
106106 if ( changes . src ) {
107107 const url = this . urlUtils . getYoutubeEmbedUrl ( changes . src . currentValue ) || changes . src . currentValue ;
108108
109- if ( this . platform . is ( 'ios' ) && ! this . urlUtils . isLocalFileUrl ( url ) ) {
109+ if ( this . platform . is ( 'ios' ) && url && ! this . urlUtils . isLocalFileUrl ( url ) ) {
110110 // Save a "fake" cookie for the iframe's domain to fix a bug in WKWebView.
111111 try {
112112 const win = < WKWebViewCookiesWindow > window ;
113113 const urlParts = CoreUrl . parse ( url ) ;
114114
115- await win . WKWebViewCookies . setCookie ( {
116- name : 'MoodleAppCookieForWKWebView' ,
117- value : '1' ,
118- domain : urlParts . domain ,
119- } ) ;
115+ if ( urlParts . domain ) {
116+ await win . WKWebViewCookies . setCookie ( {
117+ name : 'MoodleAppCookieForWKWebView' ,
118+ value : '1' ,
119+ domain : urlParts . domain ,
120+ } ) ;
121+ }
120122 } catch ( err ) {
121123 // Ignore errors.
122124 this . logger . error ( 'Error setting cookie' , err ) ;
You can’t perform that action at this time.
0 commit comments