Fix being able to add empty instructions
authorMatthias Schmidt <gravatronics@live.com>
Tue, 12 Mar 2019 17:50:55 +0000 (18:50 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 12 Mar 2019 17:50:55 +0000 (18:50 +0100)
See #2772

wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/Instructions.js

index bfe45517f13776d603eeba51ceda8a72a4ee8821..d2ffd4ff5846c3970a93292ccf1cbcff437d358f 100644 (file)
@@ -146,6 +146,12 @@ define([
                        // note: data will be validated/filtered by the server
                        
                        var pipField = elById(this._formFieldId + '_instructions' + instructionsId + '_pip');
+                       
+                       // ignore pressing button if no PIP has been selected
+                       if (!pipField.value) {
+                               return;
+                       }
+                       
                        var valueField = elById(this._formFieldId + '_instructions' + instructionsId + '_value');
                        var runStandaloneField = elById(this._formFieldId + '_instructions' + instructionsId + '_runStandalone');
                        var applicationField = elById(this._formFieldId + '_instructions' + instructionsId + '_application');