Skip to content

Commit

Permalink
0.5.1+: prohibit null in SavedState.builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Jan 23, 2017
1 parent 373ef3d commit 3cdd557
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Added `Bundleable` interface to allow saving view's state to Bundle
- Added `BackstackDelegate.restoreViewFromState()` method to mirror `persistViewToState()`
- `getSavedState()` now returns a new `SavedState` instead of throwing error if the key has no state bound to it
- Added `SavedState.viewHierarchyState` default value `new SparseArray<>()`, null is prohibited

-Simple Stack 0.5.0 (2017-01-22)
---------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public Builder setKey(Parcelable key) {
}

public Builder setViewHierarchyState(SparseArray<Parcelable> viewHierarchyState) {
if(viewHierarchyState == null) {
throw new IllegalArgumentException("Provided sparse array for view hierarchy state cannot be null");
}
this.viewHierarchyState = viewHierarchyState;
return this;
}
Expand Down

0 comments on commit 3cdd557

Please sign in to comment.