diff options
author | Sven Gothel <[email protected]> | 2012-02-25 13:58:13 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-25 13:58:13 +0100 |
commit | 90e4f6aa688c9730bcdedea727031d5dccb32b39 (patch) | |
tree | 0d9256fb312402f0ff861f5653b31c93c56aa1ad /src/jogl/classes/com/jogamp/opengl/JoglVersion.java | |
parent | 1c8f158c57a13274e3776d3ecb24cbd1c9765741 (diff) |
JoglVersion: Avoid NPE if no caps are available.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/JoglVersion.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/JoglVersion.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java index 40790e770..7bf299383 100644 --- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java +++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java @@ -78,10 +78,12 @@ public class JoglVersion extends JogampVersion { if(null!=factory) { try { final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(device); - for(int i=0; i<availCaps.size(); i++) { - sb.append("\t").append(availCaps.get(i)).append(Platform.getNewline()); + if(null != availCaps && availCaps.size()>0) { + for(int i=0; i<availCaps.size(); i++) { + sb.append("\t").append(availCaps.get(i)).append(Platform.getNewline()); + } + done = true; } - done = true; } catch (GLException gle) { /* n/a */ } } if(!done) { |