Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Fix crash in setJavaObject if no fields mapped
Browse files Browse the repository at this point in the history
  • Loading branch information
nikreiman committed Apr 8, 2016
1 parent 0f28c22 commit 9870ca5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/cpp/JavaClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ void JavaClass::setJavaObject(JNIEnv *env, jobject javaThis) {
mapFields();
}

for (FieldMap::const_iterator iter = _fields->begin(); iter != _fields->end(); ++iter) {
// If there are no fields to be mapped, then bail out
if (_fields == NULL) {
return;
}

for (FieldMap::const_iterator iter = _fields->begin(); iter != _fields->end(); ++iter) {
std::string key = iter->first;
LOG_DEBUG("Copying field '%s'", key.c_str());

Expand Down

0 comments on commit 9870ca5

Please sign in to comment.