about summary refs log tree commit diff
path: root/third_party/nix/src/build-remote/build-remote.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/build-remote/build-remote.cc')
-rw-r--r--third_party/nix/src/build-remote/build-remote.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/nix/src/build-remote/build-remote.cc b/third_party/nix/src/build-remote/build-remote.cc
index 82ac2014ef75..0aeadd0510d2 100644
--- a/third_party/nix/src/build-remote/build-remote.cc
+++ b/third_party/nix/src/build-remote/build-remote.cc
@@ -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 {