Skip to content

Commit 4559b5a

Browse files
committed
check for string m_data before creating the string path
1 parent 82d897d commit 4559b5a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

obse/obse/Commands_Inventory.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,10 @@ static bool PathFunc_Execute(COMMAND_ARGS, UInt32 whichValue, EMode mode)
26262626
case kGet:
26272627
{
26282628
std::string sFilePath;
2629+
if(theString->m_data == nullptr) {
2630+
*result = 0;
2631+
break;
2632+
}
26292633
if (whichValue == kVal_Icon)
26302634
sFilePath = std::string("data\\textures\\menus\\icons\\") + std::string(theString->m_data);
26312635
else
@@ -6903,4 +6907,4 @@ DEFINE_COMMAND(EquipItemSilent, equips the item without messages or sounds, 1, 2
69036907
DEFINE_COMMAND(UnequipItemSilent, unequips the item without messages or soudns, 1, 2, kParams_EquipItem);
69046908

69056909
DEFINE_COMMAND(GetEquippedTorchTimeLeft, returns the time left for the equipped torch, 1, 0, NULL);
6906-
DEFINE_COMMAND(SetGoldValue_T, sets the value of the item without saving the change in the savegame, 0, 2, kParams_SetObjectInteger);
6910+
DEFINE_COMMAND(SetGoldValue_T, sets the value of the item without saving the change in the savegame, 0, 2, kParams_SetObjectInteger);

obse_whatsnew.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
xOBSE 22.12
2+
Fix/Changes:
3+
- Fix crashes for IsIconPathValid and IsModelPathValid in case of record without the respective record (records without icon subrecords are valid at least)
4+
15
xOBSE 22.11
26
Fix/Changes:
37
- Use correct length for stringVar serialization and ToString($) operator for multibyte strings

0 commit comments

Comments
 (0)