Add a utility function buffer-narrowed-p, and use it.