From d14c793c0a6a059ab40fc06201dd2a275aad1621 Mon Sep 17 00:00:00 2001 From: pinpong Date: Mon, 23 Oct 2017 21:37:27 +0200 Subject: [PATCH] fixed #45 --- src/main/java/jota/utils/TrytesConverter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/jota/utils/TrytesConverter.java b/src/main/java/jota/utils/TrytesConverter.java index c1c2ac0c..e1445452 100644 --- a/src/main/java/jota/utils/TrytesConverter.java +++ b/src/main/java/jota/utils/TrytesConverter.java @@ -72,6 +72,10 @@ public static String toTrytes(String inputString) { */ public static String toString(String inputTrytes) { + // If input length is odd, return null + if (inputTrytes.length() % 2 != 0) + return null; + StringBuilder string = new StringBuilder(); for (int i = 0; i < inputTrytes.length(); i += 2) {