File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -106,8 +106,8 @@ public void prepare() throws IOException {
106
106
item .dataOffset = offset ;
107
107
map .put (stringData , offset );
108
108
if (useUTF8 ) {
109
- int length = stringData .length ();
110
- byte [] data = stringData .getBytes ("UTF-8" );
109
+ int length = stringData == null ? 0 : stringData .length ();
110
+ byte [] data = stringData == null ? new byte [ 0 ] : stringData .getBytes ("UTF-8" );
111
111
int u8lenght = data .length ;
112
112
113
113
if (length > 0x7F ) {
@@ -125,8 +125,8 @@ public void prepare() throws IOException {
125
125
baos .write (0 );
126
126
offset += 3 + u8lenght ;
127
127
} else {
128
- int length = stringData .length ();
129
- byte [] data = stringData .getBytes ("UTF-16LE" );
128
+ int length = stringData == null ? 0 : stringData .length ();
129
+ byte [] data = stringData == null ? new byte [ 0 ] : stringData .getBytes ("UTF-16LE" );
130
130
if (length > 0x7FFF ) {
131
131
int x = (length >> 16 ) | 0x8000 ;
132
132
baos .write (x );
You can’t perform that action at this time.
0 commit comments