File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -682,12 +682,16 @@ class CWebDiffWindow : public IWebDiffWindow
682
682
ComPtr<IWebDiffCallback> callback2 (callback);
683
683
const wchar_t * script =
684
684
LR"(
685
+ (function() {
685
686
const elms = document.querySelectorAll('.wwd-diff');
686
- elms.forEach(function(el) {
687
- el.addEventListener('dblclick', function() {
688
- window.chrome.webview.postMessage('wwdid=' + el.dataset['wwdid']);
687
+ if (elms) {
688
+ elms.forEach(function(el) {
689
+ el.addEventListener('dblclick', function() {
690
+ window.chrome.webview.postMessage('wwdid=' + el.dataset['wwdid']);
691
+ });
689
692
});
690
- });
693
+ }
694
+ })();
691
695
)" ;
692
696
HRESULT hr = m_webWindow[pane].ExecuteScriptInAllFrames (script,
693
697
Callback<IWebDiffCallback>([this , pane, callback2](const WebDiffCallbackResult& result) -> HRESULT
You can’t perform that action at this time.
0 commit comments