changeset 4:c32080f364c6

minor bugs
author dwinter
date Fri, 02 Dec 2011 09:25:37 +0100
parents e5f0906c107c
children 0be9d53a6967
files src/de/mpiwg/itgroup/annotationManager/restlet/AddAndSearchAnnotations.java
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/de/mpiwg/itgroup/annotationManager/restlet/AddAndSearchAnnotations.java	Fri Nov 25 08:43:25 2011 +0100
+++ b/src/de/mpiwg/itgroup/annotationManager/restlet/AddAndSearchAnnotations.java	Fri Dec 02 09:25:37 2011 +0100
@@ -372,7 +372,15 @@
 
 			try {
 				JSONObject jo = jrep.getJsonObject();
-				String mode = jo.getString("mode"); // hole modus
+				if(jo==null){
+					setStatus(Status.SERVER_ERROR_INTERNAL);
+					return null;
+				}
+				
+				String mode=null;
+				if(jo.has("mode")){
+					mode = jo.getString("mode"); // hole modus
+				}
 				if (mode==null || mode.equals(""))
 					mode="annotea"; // default mode (annotea) TODO make this configurable