Fix problematic query in TOutputGLSLBase::visitDeclaration.

There was an invalid derefernce that for some reason was not
caught on the bots.

Bug: angleproject:2456
No-Try: True
Change-Id: I088e9671122fd25077027cb2eb577aa099fdcacf
Reviewed-on: https://chromium-review.googlesource.com/1015287
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Luc Ferron <lucferron@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 7a1be2e..a7534b0 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -995,7 +995,8 @@
         const TIntermSequence &sequence = *(node->getSequence());
         TIntermTyped *variable          = sequence.front()->getAsTyped();
         writeLayoutQualifier(variable);
-        writeVariableType(variable->getType(), &variable->getAsSymbolNode()->variable());
+        TIntermSymbol *symbolNode = variable->getAsSymbolNode();
+        writeVariableType(variable->getType(), symbolNode ? &symbolNode->variable() : nullptr);
         if (variable->getAsSymbolNode() == nullptr ||
             variable->getAsSymbolNode()->variable().symbolType() != SymbolType::Empty)
         {