From dcaeec7ff78f70f81243fb7b24c1d740fd748adb Mon Sep 17 00:00:00 2001
From: Brett Porter <brett@apache.org>
Date: Mon, 25 Feb 2008 13:44:23 +0000
Subject: [PATCH] [MRM-731] fix failure introduced by previous commit

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@630844 13f79535-47bb-0310-9956-ffa450edef68
---
 .../archiva/repository/content/DefaultPathParser.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
index c123f5734..e43bf073f 100644
--- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
+++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
@@ -156,7 +156,12 @@ public class DefaultPathParser implements PathParser
                     break;
                 case 0:
                     // End of the filename, only a simple extension left. - Set the type.
-                    artifact.setType( ArtifactExtensionMapping.mapExtensionToType( parser.getExtension() ) );
+                    String type = ArtifactExtensionMapping.mapExtensionToType( parser.getExtension() );
+                    if ( type == null )
+                    {
+                        throw new LayoutException( "Invalid artifact: no type was specified" );
+                    }
+                    artifact.setType( type );
                     break;
             }