log an error when dequeueBuffer gets a NULL Fence

Bug: 9858745
Change-Id: If35d6a7d770bf0a42d55bc55880a9ddb721fcfd0
diff --git a/libs/gui/IGraphicBufferProducer.cpp b/libs/gui/IGraphicBufferProducer.cpp
index 48b2870..e3d2a20 100644
--- a/libs/gui/IGraphicBufferProducer.cpp
+++ b/libs/gui/IGraphicBufferProducer.cpp
@@ -94,13 +94,10 @@
             return result;
         }
         *buf = reply.readInt32();
-        bool fenceWasWritten = reply.readInt32();
-        if (fenceWasWritten) {
-            // If the fence was written by the callee, then overwrite the
-            // caller's fence here.  If it wasn't written then don't touch the
-            // caller's fence.
+        bool nonNull = reply.readInt32();
+        if (nonNull) {
             *fence = new Fence();
-            reply.read(*(fence->get()));
+            reply.read(**fence);
         }
         result = reply.readInt32();
         return result;
@@ -209,7 +206,7 @@
             reply->writeInt32(buf);
             reply->writeInt32(fence != NULL);
             if (fence != NULL) {
-                reply->write(*fence.get());
+                reply->write(*fence);
             }
             reply->writeInt32(result);
             return NO_ERROR;