handle null path better (should never happen ... chasing down unrelated memory trashing...)

This commit is contained in:
Kelvin Sherlock 2018-11-21 23:53:51 -05:00
parent 65661f4109
commit b92d2b00e7
1 changed files with 13 additions and 4 deletions

View File

@ -119,8 +119,13 @@ Rect r;
r = (**CtrlHand).ctlRect;
EraseRect(&r);
SetCtlValue(gstr->length, CtrlHand);
SetCtlTitle(2 + (Pointer)gstr, (Handle)CtrlHand);
if (data) {
SetCtlValue(gstr->length, CtrlHand);
SetCtlTitle(gstr->text, (Handle)CtrlHand);
} else {
SetCtlValue(0, CtrlHand);
SetCtlTitle("", (Handle)CtrlHand);
}
}
void DoConfig(Word MyID)
@ -143,8 +148,12 @@ Handle newPath = NULL;
SetPort(win);
// set the current path text...
HLock(rPath);
SetText(win, CtrlPath, *rPath);
if (rPath) {
HLock(rPath);
SetText(win, CtrlPath, *rPath);
} else {
SetText(win, CtrlPath, NULL);
}
for (ok = true; ok;)
{