diff options
author | Jason Sams <rjsams@android.com> | 2010-03-03 13:03:18 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-03-03 14:14:37 -0800 |
commit | a2cf755a28a1e7ffff2955df656d714f40e4d715 (patch) | |
tree | f95205908caee236ace7f0ecaf3874a261844201 /rsScript.cpp | |
parent | 779729718eab8ab5d1a3cd4b755a735acc241e6c (diff) | |
download | rs-a2cf755a28a1e7ffff2955df656d714f40e4d715.tar.gz |
Improve RS error handling. On errors RS will now store the error and a message that can be read from the app. RS will then not continue rendering frames while an unchecked error is present until new state is received.
Diffstat (limited to 'rsScript.cpp')
-rw-r--r-- | rsScript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rsScript.cpp b/rsScript.cpp index cb1436b0..a33933b6 100644 --- a/rsScript.cpp +++ b/rsScript.cpp @@ -96,6 +96,10 @@ void rsi_ScriptSetInvoke(Context *rsc, const char *name, uint32_t slot) void rsi_ScriptInvoke(Context *rsc, RsScript vs, uint32_t slot) { Script *s = static_cast<Script *>(vs); + if (s->mEnviroment.mInvokables[slot] == NULL) { + rsc->setError(RS_ERROR_BAD_SCRIPT, "Calling invoke on bad script"); + return; + } s->setupScript(); s->mEnviroment.mInvokables[slot](); } |