Skip to content

Commit

Permalink
fix: null dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Aug 20, 2023
1 parent fcb0cf8 commit f9d950f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/new_subscr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3181,16 +3181,14 @@ int32_t SubscrPage::move_legacy(int dir, int startp, int fp, int fp2, int fp3, b

if(verify)
{
SubscrWidget* widg = get_widg_pos(startp);
int32_t wpn = widg ? widg->getItemVal() : -1;
equip_only = item_only = true;
if(widg->getType() != widgITEMSLOT || (widg->flags&SUBSCR_CURITM_NONEQP))
wpn = -1;

if(wpn > 0 && startp != fp && startp != fp2 && startp != fp3)
{
return startp;
}
if(startp != fp && startp != fp2 && startp != fp3)
if(SubscrWidget* widg = get_widg_pos(startp))
{
if(widg->getType() == widgITEMSLOT && !(widg->flags&SUBSCR_CURITM_NONEQP)
&& widg->getItemVal() > 0)
return startp;
}
}

int32_t p=-1;
Expand Down

0 comments on commit f9d950f

Please sign in to comment.