diff --git a/car-telephony-common/src/com/android/car/telephony/common/TelecomUtils.java b/car-telephony-common/src/com/android/car/telephony/common/TelecomUtils.java
index a80a854..df1713b 100644
--- a/car-telephony-common/src/com/android/car/telephony/common/TelecomUtils.java
+++ b/car-telephony-common/src/com/android/car/telephony/common/TelecomUtils.java
@@ -286,29 +286,33 @@
                     null);
         }
 
-        Contact contact = InMemoryPhoneBook.get().lookupContactEntry(number);
-        if (contact != null) {
-            String name = contact.getDisplayName();
-            String nameAlt = contact.getDisplayNameAlt();
-            if (TextUtils.isEmpty(name)) {
-                name = getReadableNumber(context, number);
-            }
-            if (TextUtils.isEmpty(nameAlt)) {
-                nameAlt = name;
-            }
+        if (InMemoryPhoneBook.isInitialized()) {
+            Contact contact = InMemoryPhoneBook.get().lookupContactEntry(number);
+            if (contact != null) {
+                String name = contact.getDisplayName();
+                String nameAlt = contact.getDisplayNameAlt();
+                if (TextUtils.isEmpty(name)) {
+                    name = getReadableNumber(context, number);
+                }
+                if (TextUtils.isEmpty(nameAlt)) {
+                    nameAlt = name;
+                }
 
-            PhoneNumber phoneNumber = contact.getPhoneNumber(context, number);
-            CharSequence typeLabel = phoneNumber == null ? "" : phoneNumber.getReadableLabel(
-                    context.getResources());
+                PhoneNumber phoneNumber = contact.getPhoneNumber(context, number);
+                CharSequence typeLabel = phoneNumber == null ? "" : phoneNumber.getReadableLabel(
+                        context.getResources());
 
-            return new PhoneNumberInfo(
-                    number,
-                    name,
-                    nameAlt,
-                    contact.getInitials(),
-                    contact.getAvatarUri(),
-                    typeLabel.toString(),
-                    contact.getLookupKey());
+                return new PhoneNumberInfo(
+                        number,
+                        name,
+                        nameAlt,
+                        contact.getInitials(),
+                        contact.getAvatarUri(),
+                        typeLabel.toString(),
+                        contact.getLookupKey());
+            }
+        } else {
+          L.d(TAG, "InMemoryPhoneBook not initialized.");
         }
 
         String name = null;
