File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/addon/mod/quiz/pages/player Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,9 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy {
154154
155155 await this . domUtils . showConfirm ( this . translate . instant ( 'addon.mod_quiz.confirmleavequizonerror' ) ) ;
156156
157- this . domUtils . triggerFormCancelledEvent ( this . formElement . nativeElement , this . sitesProvider . getCurrentSiteId ( ) ) ;
157+ if ( this . formElement ) {
158+ this . domUtils . triggerFormCancelledEvent ( this . formElement . nativeElement , this . sitesProvider . getCurrentSiteId ( ) ) ;
159+ }
158160 } finally {
159161 modal . dismiss ( ) ;
160162 }
@@ -589,8 +591,10 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy {
589591 this . autoSave . cancelAutoSave ( ) ;
590592 this . autoSave . hideAutoSaveError ( ) ;
591593
592- this . domUtils . triggerFormSubmittedEvent ( this . formElement . nativeElement , ! this . offline ,
593- this . sitesProvider . getCurrentSiteId ( ) ) ;
594+ if ( this . formElement ) {
595+ this . domUtils . triggerFormSubmittedEvent ( this . formElement . nativeElement , ! this . offline ,
596+ this . sitesProvider . getCurrentSiteId ( ) ) ;
597+ }
594598 } ) ;
595599 }
596600
You can’t perform that action at this time.
0 commit comments