Skip to content

Commit

Permalink
Wrap onreadystatechange function body with try catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
KarolDawidziuk committed Aug 8, 2024
1 parent a757c3d commit e35bbad
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/ckeditor_version-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@

request.onreadystatechange = function() {
if ( request.readyState === 4 && request.status === 200 ) {
var response = JSON.parse( request.responseText );
try {
var response = JSON.parse( request.responseText );

versionInfo.latest = parseVersion( response.latestVersion );
versionInfo.secure = parseVersion( response.secureVersion );
versionInfo.isLatest = isLatestVersion();
versionInfo.isSecure = isSecureVersion();
versionInfo.latest = parseVersion( response.latestVersion );
versionInfo.secure = parseVersion( response.secureVersion );
versionInfo.isLatest = isLatestVersion();
versionInfo.isSecure = isSecureVersion();

callback();
callback();
} catch ( e ) {}
}
};

Expand Down

0 comments on commit e35bbad

Please sign in to comment.