explicit check for writer instance being None