commit | 2caa2f99e42127faabd1c50cebd6d57a805f6f1c | [log] [tgz] |
---|---|---|
author | Akron <nils@diewald-online.de> | Tue Sep 12 11:50:16 2017 +0200 |
committer | Akron <nils@diewald-online.de> | Tue Sep 12 11:50:16 2017 +0200 |
tree | 527d99bc487e8652707f224af73373240746686a | |
parent | 6a2ddb30f04ac7ea5de30b9033723aaa74adebd1 [diff] |
Fix null pointer in HTML escaping Change-Id: Ic35e9c53d2c68bb66c99be58d7f2dae1b1bd00f6
diff --git a/src/main/java/de/ids_mannheim/korap/util/KrillString.java b/src/main/java/de/ids_mannheim/korap/util/KrillString.java index 3e0095e..845325e 100644 --- a/src/main/java/de/ids_mannheim/korap/util/KrillString.java +++ b/src/main/java/de/ids_mannheim/korap/util/KrillString.java
@@ -57,6 +57,10 @@ * @return The secured string. */ public static String escapeHTML (String text) { + + if (text == null) + return ""; + return text.replace("&", "&").replace("<", "<") .replace(">", ">").replace("\"", """); };