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
682682 ComPtr<IWebDiffCallback> callback2 (callback);
683683 const wchar_t * script =
684684LR"(
685+ (function() {
685686 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+ });
689692 });
690- });
693+ }
694+ })();
691695)" ;
692696 HRESULT hr = m_webWindow[pane].ExecuteScriptInAllFrames (script,
693697 Callback<IWebDiffCallback>([this , pane, callback2](const WebDiffCallbackResult& result) -> HRESULT
You can’t perform that action at this time.
0 commit comments