diff --git a/greycat/src/main/java/greycat/utility/Base64.java b/greycat/src/main/java/greycat/utility/Base64.java
index <HASH>..<HASH> 100644
--- a/greycat/src/main/java/greycat/utility/Base64.java
+++ b/greycat/src/main/java/greycat/utility/Base64.java
@@ -401,6 +401,9 @@ public class Base64 {
      * @param buffer    the buffer to fill
      */
     public static void encodeStringToBuffer(String s, Buffer buffer) {
+        if(s == null) {
+            return;
+        }
         int sLength = s.length();
         char currentSourceChar;
         int currentEncodedChar = 0;
Protection of StringArray serialization when value is null