Hi guys
I am importing a bunch of mails into openkm. To do so I had to add null checks in
https://github.com/openkm/document-mana ... tUtil.java
Here the git diff:
Floriano
I am importing a bunch of mails into openkm. To do so I had to add null checks in
https://github.com/openkm/document-mana ... tUtil.java
Here the git diff:
Code: Select all
Cheersdiff --git a/src/main/java/com/openkm/util/FormatUtil.java b/src/main/java/com/openkm/util/FormatUtil.java
index 1a3a5a7..2ec635b 100644
--- a/src/main/java/com/openkm/util/FormatUtil.java
+++ b/src/main/java/com/openkm/util/FormatUtil.java
@@ -304,6 +304,7 @@ public class FormatUtil {
* Fix UTF-8 NULL
*/
public static String fixUTF8(String input) {
+ if(input == null) return input;
return input.replace('\u0000', '\u0020');
}
@@ -313,6 +314,7 @@ public class FormatUtil {
* http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates
*/
public static String trimUnicodeSurrogates(String text) {
+ if(text == null) return text;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
Floriano