sr: fix possible null-pointer dereference