Check if there are any pages before calling getPage(), which resolves #2