float: Handle desk nullptr in FloatImpl

It can be null for ClientControlledWindows, which try to handle float
precommit. Return early in this case.

Bug: b/285038503
Change-Id: I5eb0e331218dec0a56f7919195cc16874b38046d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574614
Reviewed-by: Sammie Quon <sammiequon@chromium.org>
Commit-Queue: Sophie Wen <sophiewen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151003}
diff --git a/ash/wm/float/float_controller.cc b/ash/wm/float/float_controller.cc
index 9c719f0..691c4db 100644
--- a/ash/wm/float/float_controller.cc
+++ b/ash/wm/float/float_controller.cc
@@ -899,7 +899,9 @@
   // Get the desk where the window belongs to before moving it to float
   // container.
   const Desk* desk = desks_util::GetDeskForContext(window);
-  DCHECK(desk);
+  if (!desk) {
+    return;
+  }
 
   // TODO(b/267363112): Allow a floated window to be assigned to all desks.
   // If window is visible to all desks, unset it.