Add op count check before attempting to write operations

Test: th
Bug: 313962438
Change-Id: I0e288a42984d737d327236693a6b69c03a7ecc6e
2 files changed