diff --git a/library/src/org/holoeverywhere/LayoutInflater.java b/library/src/org/holoeverywhere/LayoutInflater.java
index <HASH>..<HASH> 100644
--- a/library/src/org/holoeverywhere/LayoutInflater.java
+++ b/library/src/org/holoeverywhere/LayoutInflater.java
@@ -179,12 +179,23 @@ public class LayoutInflater extends android.view.LayoutInflater implements Clone
     }
 
     public static void registerPackage(String packageName) {
-        packageName = Package.getPackage(packageName).getName();
-        if (!sPackages.contains(packageName)) {
+        packageName = resolveFullPackageName(packageName);
+
+        if (packageName != null && !sPackages.contains(packageName)) {
             sPackages.add(packageName);
         }
     }
 
+    private static String resolveFullPackageName(String packageName) {
+        Package resolvedPackage = Package.getPackage(packageName);
+
+        if (resolvedPackage == null) {
+            return null;
+        }
+
+        return resolvedPackage.getName();
+    }
+
     /**
      * @deprecated Use {@link #register(Class<? extends View>...)} instead
      */
Fixed layout inflater throwing NullPointerException during initization.
getPackage method may return null in non-real environment like
Robolectric.