Despite my misgivings, we ultimately were advised by Support to remove the "if gr.canWrite())" line, and so far that's worked without creating any issues I'm aware of