Add regression test for read function null check