diff --git a/parser/html/jArray.h b/parser/html/jArray.h
index cfa3be6ff06..e4d935df2bd 100644
--- a/parser/html/jArray.h
+++ b/parser/html/jArray.h
@@ -65,7 +65,7 @@ jArray::jArray(T* const a, L const len)
template
jArray::jArray(L const len)
- : arr(new T[len]), length(len)
+ : arr(len ? new T[len] : 0), length(len)
{
}