@@ -197,37 +197,58 @@ void CDiscordPlugin::exec(const CSAORIInput& in,CSAORIOutput& out)
197197 }
198198 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomAppid" ) == 0 )
199199 {
200- Discord_ReSetAPPid (SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8).c_str ());
200+ string_t arg0;
201+ if (in.args .size ())
202+ arg0 = in.args [0 ];
203+ Discord_ReSetAPPid (SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8).c_str ());
201204 BaseUpdate ();
202205 }
203206 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomState" ) == 0 )
204207 {
205- CustomState = SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8);
208+ string_t arg0;
209+ if (in.args .size ())
210+ arg0 = in.args [0 ];
211+ CustomState = SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8);
206212 BaseUpdate ();
207213 }
208214 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomDetail" ) == 0 )
209215 {
210- CustomDetail = SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8);
216+ string_t arg0;
217+ if (in.args .size ())
218+ arg0 = in.args [0 ];
219+ CustomDetail = SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8);
211220 BaseUpdate ();
212221 }
213222 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomLargeImageKey" ) == 0 )
214223 {
215- LargeImageKey = SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8);
224+ string_t arg0;
225+ if (in.args .size ())
226+ arg0 = in.args [0 ];
227+ LargeImageKey = SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8);
216228 BaseUpdate ();
217229 }
218230 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomLargeImageText" ) == 0 )
219231 {
220- LargeImageText = SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8);
232+ string_t arg0;
233+ if (in.args .size ())
234+ arg0 = in.args [0 ];
235+ LargeImageText = SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8);
221236 BaseUpdate ();
222237 }
223238 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomSmallImageKey" ) == 0 )
224239 {
225- SmallImageKey = SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8);
240+ string_t arg0;
241+ if (in.args .size ())
242+ arg0 = in.args [0 ];
243+ SmallImageKey = SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8);
226244 BaseUpdate ();
227245 }
228246 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomSmallImageText" ) == 0 )
229247 {
230- SmallImageText = SAORI_FUNC::UnicodeToMultiByte (in.args [0 ], CP_UTF8);
248+ string_t arg0;
249+ if (in.args .size ())
250+ arg0 = in.args [0 ];
251+ SmallImageText = SAORI_FUNC::UnicodeToMultiByte (arg0, CP_UTF8);
231252 BaseUpdate ();
232253 }
233254 else if (wcsicmp (in.id .c_str (), L" OnDiscordPluginCustomALL" ) == 0 )
0 commit comments