Browse Source

throw exception if clipboard corrupt

Teh-Hai Julian Zheng 7 years ago
parent
commit
b4a7d3529c
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/ui/controller/ClipboardController.java

+ 6 - 2
src/ui/controller/ClipboardController.java

@@ -149,9 +149,13 @@ public class ClipboardController {
 				&& !content.isDataFlavorSupported(DataFlavor.allHtmlFlavor)) {
 
 			String str = (String) content.getTransferData(DataFlavor.stringFlavor);
-
-			if (parser.parse(str).isJsonObject())
+			
+			
+			if (parser.parse(str).isJsonObject()) 
 				json = (JsonObject) parser.parse(str);
+			else
+				throw new JsonParseException("Unknown Clipboard Information");
+
 		} else
 			return;