fix(3p/nix): fix null pointer dereferences

Change-Id: I4c37febcd4978f17720b2526c267c6bf96e84bcc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1417
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Kane York 2020-07-23 19:05:41 -07:00 committed by kanepyork
parent e191e0afad
commit 388b5f1abe

View file

@ -147,7 +147,7 @@ static int _main(int argc, char* argv[]) {
continue;
}
bool best = false;
if (!bestSlotLock) {
if (!bestMachine || !bestSlotLock) {
best = true;
} else if (load / m.speedFactor <
bestLoad / bestMachine->speedFactor) {
@ -170,7 +170,7 @@ static int _main(int argc, char* argv[]) {
}
}
if (!bestSlotLock) {
if (!bestSlotLock || !bestMachine) {
if (rightType && !canBuildLocally) {
std::cerr << "# postpone\n";
} else {