Don't attempt to create a copy of null ProgramData
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2019 19:26:10 +0000 (22:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2019 19:26:10 +0000 (22:26 +0300)
source/renderpass.cpp

index 55776cca1e9abb6ab374fc794771b7ba4e8ddc2f..be5bb170280844d88c8b3e8f46fd22cb72e902de 100644 (file)
@@ -55,7 +55,7 @@ RenderPass::~RenderPass()
 void RenderPass::set_shader_program(const Program *prog, const ProgramData *data)
 {
        shprog = prog;
-       shdata = new ProgramData(*data);
+       shdata = (data ? new ProgramData(*data) : 0);
 }
 
 const string &RenderPass::get_slotted_uniform_name(const string &slot) const