File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,16 @@ export function initCompWebHookEditor() {
22
22
} ) ;
23
23
}
24
24
25
- const updateContentType = function ( ) {
26
- const visible = document . getElementById ( 'http_method' ) ?. value === 'POST' ;
27
- toggleElem ( document . getElementById ( 'content_type' ) ?. parentNode . parentNode , visible ) ;
28
- } ;
29
- updateContentType ( ) ;
25
+ const httpMethodInput = document . getElementById ( 'http_method' ) ;
26
+ if ( httpMethodInput ) {
27
+ const updateContentType = function ( ) {
28
+ const visible = httpMethodInput . value === 'POST' ;
29
+ toggleElem ( document . getElementById ( 'content_type' ) ?. parentNode . parentNode , visible ) ;
30
+ } ;
31
+ updateContentType ( ) ;
30
32
31
- document . getElementById ( 'http_method' ) ?. addEventListener ( 'change' , updateContentType ) ;
33
+ httpMethodInput . addEventListener ( 'change' , updateContentType ) ;
34
+ }
32
35
33
36
// Test delivery
34
37
document . getElementById ( 'test-delivery' ) ?. addEventListener ( 'click' , async function ( ) {
You can’t perform that action at this time.
0 commit comments