loci: rework assertions for better static analysis

Reviewer: trivial

Clang does not like deferencing a null pointer.