From 0b14bf99532fc4b70dec81d848038e70b22694da Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 7 May 2018 16:16:34 +0200 Subject: Verify the iterator is valid before trying to dereference it. --- examples/caldavresource/tests/caldavtest.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/caldavresource/tests') diff --git a/examples/caldavresource/tests/caldavtest.cpp b/examples/caldavresource/tests/caldavtest.cpp index b9886fa..32dad91 100644 --- a/examples/caldavresource/tests/caldavtest.cpp +++ b/examples/caldavresource/tests/caldavtest.cpp @@ -285,6 +285,7 @@ private slots: std::find_if(itemList.begin(), itemList.end(), [this](const KDAV2::DavItem &item) { return item.url().url().path().endsWith(addedEventUid); }); + QVERIFY(hollowDavItemIt != itemList.end()); auto davitem = ([this, &collection, &hollowDavItemIt]() -> KDAV2::DavItem { QString itemUrl = collection.url().url().toEncoded() + addedEventUid; -- cgit v1.2.3