servlet error

that to check if a writer is also available, to avoid an
IllegalStateException.