check if currentShader exists - prevents segfault

fixes #2482