This will segfault if `self.is_null()` (because `self.len()` segfaults; that will need to be addressed separately). This should instead detect the null buffer and behave appropriately (without failing).