Fix NullPointerException on saving pages introduced in d434f4d