From 617572a3d0c650271217063274af9b5c637a2879 Mon Sep 17 00:00:00 2001 From: moloko Date: Fri, 16 Oct 2020 13:10:45 +0100 Subject: [PATCH] return early from setValue if there's an error (so that it won't trigger a commitOnAnyChange commit) --- js/scorm/wrapper.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/scorm/wrapper.js b/js/scorm/wrapper.js index 92b4aac7..3d37f344 100644 --- a/js/scorm/wrapper.js +++ b/js/scorm/wrapper.js @@ -427,12 +427,11 @@ define([ errorInfo: this.scorm.debug.getInfo(errorCode), diagnosticInfo: this.scorm.debug.getDiagnosticInfo(errorCode) })); - } else { - this.logger.warn(`ScormWrapper::setValue: LMS reported that the 'set' call failed but then said there was no error!`); + return success; } + this.logger.warn(`ScormWrapper::setValue: LMS reported that the 'set' call failed but then said there was no error!`); } - if (this.commitOnAnyChange) this.debouncedCommit(); return success;