am 424b093a: am ef923fcf: Merge "fix GraphicBuffer::flatten crash issue when handle is null"
* commit '424b093a58c9f428081da991afa347183bf07847':
fix GraphicBuffer::flatten crash issue when handle is null
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index 96a7188..c4e4efa 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -235,8 +235,10 @@
buffer = reinterpret_cast<void*>(static_cast<int*>(buffer) + sizeNeeded);
size -= sizeNeeded;
- fds += handle->numFds;
- count -= handle->numFds;
+ if (handle) {
+ fds += handle->numFds;
+ count -= handle->numFds;
+ }
return NO_ERROR;
}