Use safe comparison in JavaScript

This commit is contained in:
Sebastian Serth
2023-12-22 00:50:08 +01:00
committed by Sebastian Serth
parent 9147482876
commit a9e1d491be

View File

@ -328,7 +328,7 @@ $(document).on('turbolinks:load', function () {
if (!confirm(I18n.t('exercises.form.unpublish_warning'))) { if (!confirm(I18n.t('exercises.form.unpublish_warning'))) {
$('#exercise_unpublished').prop('checked', false); $('#exercise_unpublished').prop('checked', false);
} }
} else if ($('#exercise_execution_environment_id').val() == '') { } else if ($('#exercise_execution_environment_id').val() === '') {
alert(I18n.t('exercises.form.no_execution_environment_selected')); alert(I18n.t('exercises.form.no_execution_environment_selected'));
$('#exercise_unpublished').prop('checked', true); $('#exercise_unpublished').prop('checked', true);
} }