File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -2305,14 +2305,22 @@ class LunaSongManager: public Luna<SongManager>
2305
2305
}
2306
2306
static int GetSongByChartKey (T* p, lua_State *L)
2307
2307
{
2308
- Song* pSong = p->GetSongByChartkey (SArg (1 ));
2309
- pSong->PushSelf (L);
2308
+ RString ck = SArg (1 );
2309
+ Song* pSong = p->GetSongByChartkey (ck);
2310
+ if (pSong)
2311
+ pSong->PushSelf (L);
2312
+ else
2313
+ lua_pushnil (L);
2310
2314
return 1 ;
2311
2315
}
2312
2316
static int GetStepsByChartKey (T* p, lua_State *L)
2313
2317
{
2314
- Steps* pSteps = p->GetStepsByChartkey (SArg (1 ));
2315
- pSteps->PushSelf (L);
2318
+ RString ck = SArg (1 );
2319
+ Steps* pSteps = p->GetStepsByChartkey (ck);
2320
+ if (pSteps)
2321
+ pSteps->PushSelf (L);
2322
+ else
2323
+ lua_pushnil (L);
2316
2324
return 1 ;
2317
2325
}
2318
2326
You can’t perform that action at this time.
0 commit comments