The pagetable pointer was checked against NULL after being used. Check against NULL first and then dereference it.