From 9d9369079afc7330566432b30f6cd35db69e5607 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Tue, 8 May 2007 22:26:30 +0000 Subject: [PATCH] fixed bug for amb266 --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40762 --- core/smn_player.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/smn_player.cpp b/core/smn_player.cpp index c093848d..38e6d34b 100644 --- a/core/smn_player.cpp +++ b/core/smn_player.cpp @@ -589,7 +589,8 @@ static cell_t GetWeaponName(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeError("IPlayerInfo not supported by game"); } - pContext->StringToLocalUTF8(params[2], static_cast(params[3]), pInfo->GetWeaponName(), NULL); + const char *weapon = pInfo->GetWeaponName(); + pContext->StringToLocalUTF8(params[2], static_cast(params[3]), weapon ? weapon : "", NULL); return 1; } @@ -612,7 +613,8 @@ static cell_t GetModelName(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeError("IPlayerInfo not supported by game"); } - pContext->StringToLocalUTF8(params[2], static_cast(params[3]), pInfo->GetModelName(), NULL); + const char *model = pInfo->GetModelName(); + pContext->StringToLocalUTF8(params[2], static_cast(params[3]), model ? model : "", NULL); return 1; }