We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d64302 commit 4fd89feCopy full SHA for 4fd89fe
src/IO/JSON/JSONIOHandlerImpl.cpp
@@ -1538,6 +1538,15 @@ void JSONIOHandlerImpl::readAttribute(
1538
refreshFileFromParent(writable);
1539
auto name = removeSlashes(parameters.name);
1540
auto const &jsonContents = obtainJsonContents(writable);
1541
+ if (!hasKey(jsonContents, "attributes"))
1542
+ {
1543
+ throw error::ReadError(
1544
+ error::AffectedObject::Attribute,
1545
+ error::Reason::NotFound,
1546
+ "JSON",
1547
+ "Tried looking up attribute '" + name + "' at location: " +
1548
+ setAndGetFilePosition(writable, false)->id.to_string());
1549
+ }
1550
auto const &jsonLoc = jsonContents["attributes"];
1551
setAndGetFilePosition(writable);
1552
if (!hasKey(jsonLoc, name))
0 commit comments