fix NPE when save an empty post