From 2ed2a3c199a2748435dfec2d441b905e58e7c505 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sat, 18 May 2013 08:54:02 -0400 Subject: [PATCH] takes care of log messages of size = 0 --- core/src/processing/opengl/PGL.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 0a6bde31c..6e350e398 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -1851,9 +1851,13 @@ public class PGL { gl2.glGetShaderiv(prog, GL2.GL_INFO_LOG_LENGTH, val, 0); int length = val[0]; - byte[] log = new byte[length]; - gl2.glGetProgramInfoLog(prog, length, val, 0, log, 0); - return new String(log); + if (0 < length) { + byte[] log = new byte[length]; + gl2.glGetProgramInfoLog(prog, length, val, 0, log, 0); + return new String(log); + } else { + return "Unknow error"; + } }