|
1 | 1 | // ------------------------------------------------------------------------------ |
2 | 2 | // Copyright (c) 2017 Microsoft Corporation |
3 | | -// |
| 3 | +// |
4 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
5 | 5 | // of this software and associated documentation files (the "Software"), to deal |
6 | 6 | // in the Software without restriction, including without limitation the rights |
7 | 7 | // to use, copy, modify, merge, publish, distribute, sub-license, and/or sell |
8 | 8 | // copies of the Software, and to permit persons to whom the Software is |
9 | 9 | // furnished to do so, subject to the following conditions: |
10 | | -// |
| 10 | +// |
11 | 11 | // The above copyright notice and this permission notice shall be included in |
12 | 12 | // all copies or substantial portions of the Software. |
13 | | -// |
| 13 | +// |
14 | 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
26 | 26 | import com.microsoft.graph.serializer.AdditionalDataManager; |
27 | 27 | import com.microsoft.graph.serializer.ISerializer; |
28 | 28 |
|
| 29 | +import java.util.ArrayList; |
29 | 30 | import java.util.Collections; |
30 | 31 | import java.util.List; |
31 | 32 |
|
@@ -68,7 +69,7 @@ public abstract class BaseCollectionPage<T1, T2 extends IRequestBuilder> impleme |
68 | 69 | public BaseCollectionPage(final List<T1> pageContents, final T2 nextRequestBuilder) { |
69 | 70 | // CollectionPages are never directly modifiable, either 'update'/'delete' the specific child or 'add' the new |
70 | 71 | // object to the 'children' of the collection. |
71 | | - this.pageContents = Collections.unmodifiableList(pageContents); |
| 72 | + this.pageContents = Collections.unmodifiableList(pageContents == null ? new ArrayList<T1>() : pageContents); |
72 | 73 | requestBuilder = nextRequestBuilder; |
73 | 74 | } |
74 | 75 |
|
|
0 commit comments