Prevent script error in ObjectInteractionMenu

ERROR: proplist access: proplist expected, got nil
 by: Object(18501)->OnContentsSelection() (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:887)
 by: Object(18501)->OnMenuEntrySelected({index = 0, slot = 0},2,1) (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:880)
 by: Object(18911)->DoCall(2,0,Object(18501),0,1) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:166)
 by: Object(18911)->OnClick(0,1,948,2,Object(18911)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:175)
install-platforms
Lukas Werling 2017-12-27 12:50:56 +01:00
parent 0c848be4df
commit d43051b180
1 changed files with 1 additions and 0 deletions

View File

@ -884,6 +884,7 @@ func OnMenuEntrySelected(proplist menu_info, int entry_index, int player)
private func OnContentsSelection(symbol, extra_data)
{
if (!current_menus[extra_data.slot]) return;
var target = current_menus[extra_data.slot].target;
if (!target) return;
// no target to swap to?