File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/com/microsoft/graph/http Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public String nextLink() {
5959 public final AdditionalDataManager additionalDataManager () {
6060 return additionalDataManager ;
6161 }
62-
62+ private final static String valueJsonKey = "value" ;
6363 /**
6464 * Sets the raw JSON object
6565 *
@@ -69,9 +69,9 @@ public final AdditionalDataManager additionalDataManager() {
6969 public void setRawObject (@ Nonnull final ISerializer serializer , @ Nonnull final JsonObject json ) {
7070 Objects .requireNonNull (serializer , "parameter serializer cannot be null" );
7171 Objects .requireNonNull (json , "parameter json cannot be null" );
72- if (json .has (" value" ) ) {
73- final JsonArray array = json .getAsJsonArray ("value" );
74- for (int i = 0 ; i < array .size (); i ++) {
72+ if (json .has (valueJsonKey ) && value != null && value . size () > 0 ) {
73+ final JsonArray array = json .getAsJsonArray (valueJsonKey );
74+ for (int i = 0 ; i < array .size () && i < value . size () ; i ++) {
7575 final Object targetObject = value .get (i );
7676 if (targetObject instanceof IJsonBackedObject && array .get (i ).isJsonObject ()) {
7777 ((IJsonBackedObject )targetObject ).setRawObject (serializer , array .get (i ).getAsJsonObject ());
You can’t perform that action at this time.
0 commit comments