Skip to content

Commit

Permalink
Added null pointer check and changed URL string conversion in WM_NOTIFY
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisS85 committed Jan 22, 2012
1 parent ae7fbb5 commit 8d7d29f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ bool MsgSleep(int aSleepDuration, MessageMode aMode)
if (gui_action == GUI_EVENT_RESIZE || gui_action == GUI_EVENT_DROPFILES)
g_ErrorLevel->Assign(gui_event_info); // For backward compatibility.
//this might not be the best place to put this, but other places would need a larger gui_action_errorlevel buffer or a new variable.
else if(pcontrol->type == GUI_CONTROL_LINK)
else if(pcontrol && pcontrol->type == GUI_CONTROL_LINK)
{
LITEM item = {};
item.mask=LIF_URL|LIF_ITEMID|LIF_ITEMINDEX;
Expand Down
2 changes: 1 addition & 1 deletion source/script_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8124,7 +8124,7 @@ LRESULT CALLBACK GuiWindowProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lPara
NMLINK &nmLink = *(PNMLINK)lParam;
LITEM item = nmLink.item;
//Link control tries to execute the link URL if href property is set. Otherwise, it will execute a g-label if it exists.
if (!*item.szUrl || !g_script.ActionExec((LPTSTR)CStringTCharFromWCharIfNeeded(item.szUrl), NULL, NULL, false))
if (!*item.szUrl || !g_script.ActionExec((LPTSTR)(LPCTSTR)CStringTCharFromWCharIfNeeded(item.szUrl), NULL, NULL, false))
pgui->Event(control_index, nmhdr.code, GUI_EVENT_NORMAL, item.iLink + 1); // Link control uses 1-based index for g-labels
}
return 0;
Expand Down

0 comments on commit 8d7d29f

Please sign in to comment.