Make sure to check for OBUnitCell before dereferencing.

Bug found via Clang static analysis checker.