From 6b41f568bfbd7eaa509335d7476935b323587108 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Thu, 15 Jan 2015 17:25:16 -0700 Subject: [PATCH] GraphDisplay now checks whether the stats it's passed from Lua are nil. --- src/GraphDisplay.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/GraphDisplay.cpp b/src/GraphDisplay.cpp index 116ae9fc3a..a5b8ee4c73 100644 --- a/src/GraphDisplay.cpp +++ b/src/GraphDisplay.cpp @@ -288,6 +288,14 @@ public: { StageStats *pStageStats = Luna::check( L, 1 ); PlayerStageStats *pPlayerStageStats = Luna::check( L, 2 ); + if(pStageStats == NULL) + { + luaL_error(L, "The StageStats passed to GraphDisplay:Set are nil."); + } + if(pPlayerStageStats == NULL) + { + luaL_error(L, "The PlayerStageStats passed to GraphDisplay:Set are nil."); + } p->Set( *pStageStats, *pPlayerStageStats ); COMMON_RETURN_SELF; }