diff --git a/unittests/test_dom.cpp b/unittests/test_dom.cpp index 583bdec..1a19505 100644 --- a/unittests/test_dom.cpp +++ b/unittests/test_dom.cpp @@ -196,7 +196,9 @@ TEST_F (Dom, ArrayInsideObject) { ASSERT_THAT ( obj, UnorderedElementsAre (Pair (u8"a"s, VariantWith (_)), Pair (u8"b"s, VariantWith (3)))); - auto const &arr = *std::get (obj.find (u8"a")->second); + auto const pos = obj.find (u8"a"); + ASSERT_NE (pos, obj.end ()); + auto const &arr = *std::get (pos->second); ASSERT_THAT (arr, ElementsAre (VariantWith (1), VariantWith (2))); }