Prevent error being thrown when current page is null