Fossil SCM
Fixed a null-pointer deref in /chat JS in the try-to-resend-message error handler.
Commit
86bba486c5689d361b6492d2ff21a385ae878c309110d6013e8010d3c5253dea
Parent
7994809763365ac…
1 file changed
+3
-3
+3
-3
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -1248,17 +1248,17 @@ | ||
| 1248 | 1248 | //console.debug("blob = ",state.blob); |
| 1249 | 1249 | } |
| 1250 | 1250 | const buttons = D.addClass(D.div(), 'buttons'); |
| 1251 | 1251 | D.append(w, buttons); |
| 1252 | 1252 | D.append(buttons, D.button("Discard message?", function(){ |
| 1253 | - let theMsg = findMessageWidgetParent(w); | |
| 1253 | + const theMsg = findMessageWidgetParent(w); | |
| 1254 | 1254 | if(theMsg) Chat.deleteMessageElem(theMsg); |
| 1255 | 1255 | })); |
| 1256 | 1256 | D.append(buttons, D.button("Edit message and try again?", function(){ |
| 1257 | - if(state.msg) Chat.inputValue(ta.value); | |
| 1257 | + if(state.msg) Chat.inputValue(state.msg); | |
| 1258 | 1258 | if(state.blob) BlobXferState.updateDropZoneContent(state.blob); |
| 1259 | - let theMsg = findMessageWidgetParent(w); | |
| 1259 | + const theMsg = findMessageWidgetParent(w); | |
| 1260 | 1260 | if(theMsg) Chat.deleteMessageElem(theMsg); |
| 1261 | 1261 | })); |
| 1262 | 1262 | Chat.reportErrorAsMessage(w); |
| 1263 | 1263 | }; |
| 1264 | 1264 | |
| 1265 | 1265 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -1248,17 +1248,17 @@ | |
| 1248 | //console.debug("blob = ",state.blob); |
| 1249 | } |
| 1250 | const buttons = D.addClass(D.div(), 'buttons'); |
| 1251 | D.append(w, buttons); |
| 1252 | D.append(buttons, D.button("Discard message?", function(){ |
| 1253 | let theMsg = findMessageWidgetParent(w); |
| 1254 | if(theMsg) Chat.deleteMessageElem(theMsg); |
| 1255 | })); |
| 1256 | D.append(buttons, D.button("Edit message and try again?", function(){ |
| 1257 | if(state.msg) Chat.inputValue(ta.value); |
| 1258 | if(state.blob) BlobXferState.updateDropZoneContent(state.blob); |
| 1259 | let theMsg = findMessageWidgetParent(w); |
| 1260 | if(theMsg) Chat.deleteMessageElem(theMsg); |
| 1261 | })); |
| 1262 | Chat.reportErrorAsMessage(w); |
| 1263 | }; |
| 1264 | |
| 1265 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -1248,17 +1248,17 @@ | |
| 1248 | //console.debug("blob = ",state.blob); |
| 1249 | } |
| 1250 | const buttons = D.addClass(D.div(), 'buttons'); |
| 1251 | D.append(w, buttons); |
| 1252 | D.append(buttons, D.button("Discard message?", function(){ |
| 1253 | const theMsg = findMessageWidgetParent(w); |
| 1254 | if(theMsg) Chat.deleteMessageElem(theMsg); |
| 1255 | })); |
| 1256 | D.append(buttons, D.button("Edit message and try again?", function(){ |
| 1257 | if(state.msg) Chat.inputValue(state.msg); |
| 1258 | if(state.blob) BlobXferState.updateDropZoneContent(state.blob); |
| 1259 | const theMsg = findMessageWidgetParent(w); |
| 1260 | if(theMsg) Chat.deleteMessageElem(theMsg); |
| 1261 | })); |
| 1262 | Chat.reportErrorAsMessage(w); |
| 1263 | }; |
| 1264 | |
| 1265 |