Github user pivotal-jbarrett commented on a diff in the pull request: https://github.com/apache/geode-native/pull/107#discussion_r126792435 --- Diff: src/cppcache/src/Struct.cpp --- @@ -96,16 +99,16 @@ Serializable* Struct::fromData(DataInput& input) { return this; } -const char* Struct::getFieldName(const int32_t index) const { +const std::string& Struct::getFieldName(const int32_t index) const { if (m_parent != nullptr) { return m_parent->getFieldName(index); } else { for (const auto& iter : m_fieldNames) { - if ((iter.second)->value() == index) return iter.first->asChar(); + if (iter.second == index) return (iter.first); } } - return nullptr; + return std::string(""); --- End diff -- What about throwing [`std::out_of_range`](http://en.cppreference.com/w/cpp/error/out_of_range). I don't like the idea of checking for empty string.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---