From 99ab97836befa3b1a032dcc49e8e1bae8762fdb3 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Fri, 13 Sep 2019 06:58:03 -0700 Subject: [PATCH] libsnapshot: Fix typo in nullptr check We already know 'existing_extent' is non-null (or else we would have crashed on the previous line). We fix this to check 'existing_linear_extent' against nullptr. Test: TreeHugger Change-Id: I03338bca87d1c2bd0cbea0e1ec31244ba9570a40 --- fs_mgr/libsnapshot/partition_cow_creator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs_mgr/libsnapshot/partition_cow_creator.cpp b/fs_mgr/libsnapshot/partition_cow_creator.cpp index 44d886093..3163e61d6 100644 --- a/fs_mgr/libsnapshot/partition_cow_creator.cpp +++ b/fs_mgr/libsnapshot/partition_cow_creator.cpp @@ -41,7 +41,7 @@ static std::unique_ptr Intersect(Extent* target_extent, Extent* existing // Convert target_extent and existing_extent to linear extents. Zero extents // doesn't matter and doesn't result in any intersection. auto existing_linear_extent = existing_extent->AsLinearExtent(); - if (!existing_extent) return nullptr; + if (!existing_linear_extent) return nullptr; auto target_linear_extent = target_extent->AsLinearExtent(); if (!target_linear_extent) return nullptr;