Merge "DrmStatus type checks" am: b549ebce63

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2395532

Change-Id: I482d2f2b8f1a18d7ee21aeb225200219bf3efaf6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/drm/libmediadrm/DrmStatus.cpp b/drm/libmediadrm/DrmStatus.cpp
index 0258801..f622160 100644
--- a/drm/libmediadrm/DrmStatus.cpp
+++ b/drm/libmediadrm/DrmStatus.cpp
@@ -27,21 +27,20 @@
         return;
     }
 
-    std::string errMsg;
     auto val = errorDetails["cdmError"];
-    if (!val.isNull()) {
+    if (val.isInt()) {
         mCdmErr = val.asInt();
     }
     val = errorDetails["oemError"];
-    if (!val.isNull()) {
+    if (val.isInt()) {
         mOemErr = val.asInt();
     }
     val = errorDetails["context"];
-    if (!val.isNull()) {
+    if (val.isInt()) {
         mCtx = val.asInt();
     }
     val = errorDetails["errorMessage"];
-    if (!val.isNull()) {
+    if (val.isString()) {
         mErrMsg = val.asString();
     } else {
         mErrMsg = msg;