File size: 1,015 Bytes
281d6f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/src/main/java/com/rtds/svc/CaptureTypeService.java b/src/main/java/com/rtds/svc/CaptureTypeService.java
index 52bdea3..be6c346 100644
--- a/src/main/java/com/rtds/svc/CaptureTypeService.java
+++ b/src/main/java/com/rtds/svc/CaptureTypeService.java
@@ -52,12 +52,16 @@ public class CaptureTypeService
         
         CaptureType type = em.find( CaptureType.class, url_suffix );
         
-        if( type != null )
+        if( type == null )
         {
-            return type.getCaptureFilter();
+            throw new IllegalArgumentException( "The url_suffix must exist in the database." );
         }
         
-        return null;
+        // It is okay for the capture filter itself to be null, but the CaptureType
+        // must be in the database, otherwise the user could effectively forge
+        // a capture filter for "all" just by requesting a non-existent filter.
+        
+        return type.getCaptureFilter();
     }
     
     public CaptureType find( String url_suffix )