Skip to content

Commit 3cabc58

Browse files
committed
applyHTMLLoop(): Fix callback function not being called when two pages match
1 parent 3af238c commit 3cabc58

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/WinWebDiffLib/WebDiffWindow.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,14 @@ class CWebDiffWindow : public IWebDiffWindow
11281128
std::shared_ptr<const std::list<ModifiedNode>> nodes,
11291129
IWebDiffCallback* callback)
11301130
{
1131-
ComPtr<IWebDiffCallback> callback2(callback);
11321131
size_t size = nodes->size();
1132+
if (size == 0)
1133+
{
1134+
if (callback)
1135+
callback->Invoke({ S_OK, nullptr });
1136+
return S_OK;
1137+
}
1138+
ComPtr<IWebDiffCallback> callback2(callback);
11331139
auto count = std::make_shared<size_t>();
11341140
for (auto it = nodes->rbegin(); it != nodes->rend(); ++it)
11351141
{

0 commit comments

Comments
 (0)