diff --git a/gapic/src/main/com/google/gapid/views/ShaderView.java b/gapic/src/main/com/google/gapid/views/ShaderView.java index 9417460c7..0cb6c2200 100644 --- a/gapic/src/main/com/google/gapid/views/ShaderView.java +++ b/gapic/src/main/com/google/gapid/views/ShaderView.java @@ -123,7 +123,7 @@ public static class ShaderWidget extends Composite { private final TabFolder tabFolder; private final Composite sourceContainer; private final Group statGroup; - private final TableViewer statTable; + protected final TableViewer statTable; private final GridData crossCompileGridData; private final SourceViewer spirvViewer; private final SourceViewer sourceViewer; @@ -281,19 +281,22 @@ protected void onUiThread(API.Shader result) { } public void setShader(Service.Resource resource, API.Shader shader) { - rpcController.start().listen(models.resources.loadResourceExtras(resource), - new UiCallback(this, LOG) { - @Override - protected API.ShaderExtras onRpcThread(Rpc.Result result) - throws RpcException, ExecutionException { - return result.get().getShaderExtras(); - } + if (resource != null) { + rpcController.start().listen(models.resources.loadResourceExtras(resource), + new UiCallback(this, LOG) { + @Override + protected API.ShaderExtras onRpcThread(Rpc.Result result) + throws RpcException, ExecutionException { + return result.get().getShaderExtras(); + } + + @Override + protected void onUiThread(API.ShaderExtras result) { + statTable.setInput(result.getStaticAnalysis()); + } + }); + } - @Override - protected void onUiThread(API.ShaderExtras result) { - statTable.setInput(result.getStaticAnalysis()); - } - }); loading.stopLoading(); shaderResource = resource;