Prevent crash when rotating device without pages open

Change-Id: Ic0d2b56d83b7a975f0f651ee0f5c7f380da3087b
Merge "Prevent crash when rotating device without pages open"