Skip to content

Commit

Permalink
Check for null global.
Browse files Browse the repository at this point in the history
  • Loading branch information
gogins committed Dec 13, 2017
1 parent 3c950d7 commit 7e75992
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/OpcodeBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ template<typename T> int CreateGlobalPointer(CSOUND *csound, const char *name, T
template<typename T> T *QueryGlobalPointer(CSOUND *csound, const char *name, T*& pointer)
{
T **pointer_to_pointer = static_cast<T **>(csound->QueryGlobalVariableNoCheck(csound, name));
pointer = *pointer_to_pointer;
if (pointer_to_pointer != 0) {
pointer = *pointer_to_pointer;
} else {
pointer = 0;
}
return pointer;
}

Expand Down

0 comments on commit 7e75992

Please sign in to comment.