mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03:00
enry-java: allow empty file contents
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
This commit is contained in:
parent
b020f78841
commit
9a36e8f398
@ -58,7 +58,7 @@ class GoUtils {
|
||||
static GoSlice.ByValue toGoByteSlice(byte[] bytes) {
|
||||
int length = 0;
|
||||
Pointer ptr = null;
|
||||
if (bytes != null) {
|
||||
if (bytes != null && bytes.length > 0) {
|
||||
length = bytes.length;
|
||||
ptr = ptrFromBytes(bytes);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ public class EnryTest {
|
||||
@Test
|
||||
public void getLanguageWithEmptyContent() {
|
||||
assertEquals("Go", Enry.getLanguage("baz.go", "".getBytes()));
|
||||
assertEquals("Go", Enry.getLanguage("baz.go", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user