helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Enforce consistency between packages in preview builds

Resolves https://github.com/vercel/next.js/pull/78737#discussion_r2071788535 by reverting all the changes to `scripts/create-preview-tarballs.js` from that PR.

Preview builds should be consistent. For a given commit, a package should depend on the exact same commit not a later commit. Otherwise we produce hard to debug issues and make it impossible to reproduce preview builds.


Since we always create tarballs for all packages, we can always assume that package A can depend on package B of the same commit. Once we no longer build all packages, we have to change the versioning strategy. But then we would fetch the previously built commit not the latest (which is what linking to a PR does).

For example, https://github.com/vercel/front/actions/runs/15238358866/job/42855229181 should've been the preview build from a commit but referenced the preview build of a PR.


Changed files:
filename: .github/workflows/build_and_deploy.yml
patch: @@ -532,7 +532,7 @@ jobs:
           path: crates/wasm
 
       - name: Create tarballs
-        run: GH_PR_NUMBER=${{ github.event.pull_request && github.event.pull_request.number || '' }} node scripts/create-preview-tarballs.js "${{ github.sha }}" "${{ runner.temp }}/preview-tarballs"
+        run: node scripts/create-preview-tarballs.js "${{ github.sha }}" "${{ runner.temp }}/preview-tarballs"
 
       - name: Upload tarballs
         uses: actions/upload-artifact@v4

filename: scripts/create-preview-tarballs.js
patch: @@ -82,7 +82,7 @@ async function main() {
         }
       )
       // tarball name is printed as the last line of npm-pack
-      const tarballName = stdout.trim().split('\n').pop() || ''
+      const tarballName = stdout.trim().split('\n').pop()
       console.info(`Created tarball ${path.join(packDestination, tarballName)}`)
 
       nextSwcPackageNames.add(manifest.name)
@@ -97,21 +97,16 @@ async function main() {
   ])
   const packages = JSON.parse(lernaListJson.stdout)
   const packagesByVersion = new Map()
-  const PR_NUMBER = process.env.GH_PR_NUMBER
-  const basePackageUrl = PR_NUMBER
-    ? `https://vercel-packages.vercel.app/next/prs/${PR_NUMBER}/`
-    : `https://vercel-packages.vercel.app/next/commits/${commitSha}/`
-
   for (const packageInfo of packages) {
     packagesByVersion.set(
       packageInfo.name,
-      `${basePackageUrl}${packageInfo.name}`
+      `https://vercel-packages.vercel.app/next/commits/${commitSha}/${packageInfo.name}`
     )
   }
   for (const nextSwcPackageName of nextSwcPackageNames) {
     packagesByVersion.set(
       nextSwcPackageName,
-      `${basePackageUrl}${nextSwcPackageName}`
+      `https://vercel-packages.vercel.app/next/commits/${commitSha}/${nextSwcPackageName}`
     )
   }
 
@@ -169,7 +164,7 @@ async function main() {
       }
     )
     // tarball name is printed as the last line of npm-pack
-    const tarballName = stdout.trim().split('\n').pop() || ''
+    const tarballName = stdout.trim().split('\n').pop()
     console.info(`Created tarball ${path.join(packDestination, tarballName)}`)
   }
Repository: huggingface/transformers
Pull request: [emu3] fix conversion script

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/38121 and updates the weights on the hub. Note, hub PR is not yet merged

Changed files:
filename: src/transformers/models/emu3/convert_emu3_weights_to_hf.py
patch: @@ -211,14 +211,13 @@ def convert_tiktoken(tokenizer, output_dir):
 
 
 KEYS_TO_MODIFY_MAPPING = {
+    "^model": "model.text_model",
     "^encoder": "model.vqmodel.encoder",
     "^decoder": "model.vqmodel.decoder",
     "^post_quant_conv": "model.vqmodel.post_quant_conv",
     "^quant_conv": "model.vqmodel.quant_conv",
     "^quantize": "model.vqmodel.quantize",
-    "^model": "text_model.model",
-    r"lm_head\.weight": "text_model.lm_head.weight",
-    r"^text_model\.model\.vqmodel": "vqmodel",
+    r"lm_head\.weight": "lm_head.weight",
     # rename QKV proj for the VQ-VAE model because we use SiglipAttention
     r"\.q\.": ".q_proj.",
     r"\.k\.": ".k_proj.",

filename: src/transformers/models/emu3/modeling_emu3.py
patch: @@ -1598,6 +1598,13 @@ def text_model(self):
     def vqmodel(self):
         return self.model.vqmodel
 
+    @property
+    def vocabulary_mapping(self):
+        return self.model.vocabulary_mapping
+
+    def decode_image_tokens(self, **kwargs):
+        return self.model.decode_image_tokens(**kwargs)
+
     @can_return_tuple
     @auto_docstring
     def forward(

filename: src/transformers/models/emu3/modular_emu3.py
patch: @@ -1077,6 +1077,13 @@ def text_model(self):
     def vqmodel(self):
         return self.model.vqmodel
 
+    @property
+    def vocabulary_mapping(self):
+        return self.model.vocabulary_mapping
+
+    def decode_image_tokens(self, **kwargs):
+        return self.model.decode_image_tokens(**kwargs)
+
     @can_return_tuple
     @auto_docstring
     def forward(
Repository: electron/electron
Pull request: fix: respect setAlwaysOnTop before showInactive on Linux under X11

Backport of #44078

See that PR for details.


Notes: Fixed calling setAlwaysOnTop on a hidden window which is then shown with showInactive on Linux under X11. 

Changed files:
filename: shell/browser/native_window_views.cc
patch: @@ -538,6 +538,11 @@ void NativeWindowViews::ShowInactive() {
 #if BUILDFLAG(IS_LINUX)
   if (global_menu_bar_)
     global_menu_bar_->OnWindowMapped();
+
+  // On X11, setting Z order before showing the window doesn't take effect,
+  // so we have to call it again.
+  if (IsX11())
+    widget()->SetZOrderLevel(widget()->GetZOrderLevel());
 #endif
 }
 

filename: spec/api-browser-window-spec.ts
patch: @@ -2514,6 +2514,22 @@ describe('BrowserWindow module', () => {
       expect(c.isAlwaysOnTop()).to.be.true('child is not always on top');
       expect(c._getAlwaysOnTopLevel()).to.equal('screen-saver');
     });
+
+    it('works when called prior to show', async () => {
+      w = new BrowserWindow({ show: false });
+      w.setAlwaysOnTop(true, 'screen-saver');
+      w.show();
+      await setTimeout(1000);
+      expect(w.isAlwaysOnTop()).to.be.true('is not alwaysOnTop');
+    });
+
+    it('works when called prior to showInactive', async () => {
+      w = new BrowserWindow({ show: false });
+      w.setAlwaysOnTop(true, 'screen-saver');
+      w.showInactive();
+      await setTimeout(1000);
+      expect(w.isAlwaysOnTop()).to.be.true('is not alwaysOnTop');
+    });
   });
 
   describe('preconnect feature', () => {
Repository: facebook/react
Pull request: Let ReactDOM initialize in RSC

With the `react-dom/server-rendering-stub` you can import `react-dom` in RSC so that you can call `preload` and `preinit` but if you don't alias it, then requiring it breaks because we React.Component which doesn't exist in the react subset.

Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMInReactServer-test.js
patch: @@ -0,0 +1,24 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @emails react-core
+ */
+
+'use strict';
+
+describe('ReactDOMInReactServer', () => {
+  beforeEach(() => {
+    jest.resetModules();
+    jest.mock('react', () => require('react/react.shared-subset'));
+  });
+
+  // @gate experimental && !www
+  it('can require react-dom', () => {
+    // In RSC this will be aliased.
+    require('react');
+    require('react-dom');
+  });
+});

filename: packages/react-reconciler/src/ReactFiberClassComponent.new.js
patch: @@ -82,7 +82,9 @@ const fakeInternalInstance = {};
 
 // React.Component uses a shared frozen object by default.
 // We'll use it to determine whether we need to initialize legacy refs.
-export const emptyRefsObject: $FlowFixMe = new React.Component().refs;
+export const emptyRefsObject: $FlowFixMe = React.Component
+  ? new React.Component().refs
+  : {};
 
 let didWarnAboutStateAssignmentForComponent;
 let didWarnAboutUninitializedState;

filename: packages/react-reconciler/src/ReactFiberClassComponent.old.js
patch: @@ -82,7 +82,9 @@ const fakeInternalInstance = {};
 
 // React.Component uses a shared frozen object by default.
 // We'll use it to determine whether we need to initialize legacy refs.
-export const emptyRefsObject: $FlowFixMe = new React.Component().refs;
+export const emptyRefsObject: $FlowFixMe = React.Component
+  ? new React.Component().refs
+  : {};
 
 let didWarnAboutStateAssignmentForComponent;
 let didWarnAboutUninitializedState;

filename: packages/react/react.shared-subset.js
patch: @@ -0,0 +1,10 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @flow
+ */
+
+export * from './src/ReactSharedSubset';

filename: scripts/jest/setupHostConfigs.js
patch: @@ -50,6 +50,14 @@ jest.mock('react', () => {
   return jest.requireActual(resolvedEntryPoint);
 });
 
+jest.mock('react/react.shared-subset', () => {
+  const resolvedEntryPoint = resolveEntryFork(
+    require.resolve('react/src/ReactSharedSubset'),
+    global.__WWW__
+  );
+  return jest.requireActual(resolvedEntryPoint);
+});
+
 jest.mock('react-reconciler/src/ReactFiberReconciler', () => {
   return jest.requireActual(
     __VARIANT__
Repository: denoland/deno
Pull request: fix(ext/node): use primordials in `ext/node/polyfills/https.ts`

Towards https://github.com/denoland/deno/issues/24236


Changed files:
filename: ext/node/polyfills/https.ts
patch: @@ -1,9 +1,6 @@
 // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
 // Copyright Joyent and Node contributors. All rights reserved. MIT license.
 
-// TODO(petamoriken): enable prefer-primordials for node polyfills
-// deno-lint-ignore-file prefer-primordials
-
 import { notImplemented } from "ext:deno_node/_utils.ts";
 import { urlToHttpOptions } from "ext:deno_node/internal/url.ts";
 import {
@@ -17,6 +14,14 @@ import { type ServerHandler, ServerImpl as HttpServer } from "node:http";
 import { validateObject } from "ext:deno_node/internal/validators.mjs";
 import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
 import { Buffer } from "node:buffer";
+import { primordials } from "ext:core/mod.js";
+const {
+  ArrayPrototypeShift,
+  ArrayPrototypeUnshift,
+  ArrayIsArray,
+  ObjectPrototypeIsPrototypeOf,
+  ObjectAssign,
+} = primordials;
 
 export class Server extends HttpServer {
   constructor(opts, requestListener?: ServerHandler) {
@@ -29,11 +34,11 @@ export class Server extends HttpServer {
       validateObject(opts, "options");
     }
 
-    if (opts.cert && Array.isArray(opts.cert)) {
+    if (opts.cert && ArrayIsArray(opts.cert)) {
       notImplemented("https.Server.opts.cert array type");
     }
 
-    if (opts.key && Array.isArray(opts.key)) {
+    if (opts.key && ArrayIsArray(opts.key)) {
       notImplemented("https.Server.opts.key array type");
     }
 
@@ -42,10 +47,12 @@ export class Server extends HttpServer {
 
   _additionalServeOptions() {
     return {
-      cert: this._opts.cert instanceof Buffer
+      cert: ObjectPrototypeIsPrototypeOf(Buffer, this._opts.cert)
+        // deno-lint-ignore prefer-primordials
         ? this._opts.cert.toString()
         : this._opts.cert,
-      key: this._opts.key instanceof Buffer
+      key: ObjectPrototypeIsPrototypeOf(Buffer, this._opts.key)
+        // deno-lint-ignore prefer-primordials
         ? this._opts.key.toString()
         : this._opts.key,
     };
@@ -159,18 +166,18 @@ export function request(...args: any[]) {
   let options = {};
 
   if (typeof args[0] === "string") {
-    const urlStr = args.shift();
+    const urlStr = ArrayPrototypeShift(args);
     options = urlToHttpOptions(new URL(urlStr));
-  } else if (args[0] instanceof URL) {
-    options = urlToHttpOptions(args.shift());
+  } else if (ObjectPrototypeIsPrototypeOf(URL, args[0])) {
+    options = urlToHttpOptions(ArrayPrototypeShift(args));
   }
 
   if (args[0] && typeof args[0] !== "function") {
-    Object.assign(options, args.shift());
+    ObjectAssign(options, ArrayPrototypeShift(args));
   }
 
   options._defaultAgent = globalAgent;
-  args.unshift(options);
+  ArrayPrototypeUnshift(args, options);
 
   return new HttpsClientRequest(args[0], args[1]);
 }
Repository: electron/electron
Pull request: build: update appveyor image to latest version

Backport of #44311

See that PR for details.


Notes: none

Changed files:
filename: appveyor-woa.yml
patch: @@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-131.0.6734.0-node-20.17-0
+image: e-132.0.6781.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default

filename: appveyor.yml
patch: @@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-131.0.6734.0-node-20.17-0
+image: e-132.0.6781.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default
Repository: huggingface/transformers
Pull request: Uninstall `kernels` for AMD docker images

# What does this PR do?

Talked to @ivarflakstad offline because this cause AMD CI to fail (There were 6077 failures ...).

I will merge directly.

Changed files:
filename: docker/transformers-pytorch-amd-gpu/Dockerfile
patch: @@ -30,3 +30,6 @@ RUN cd transformers && python3 setup.py develop
 
 # Remove nvml and nvidia-ml-py as it is not compatible with ROCm. apex is not tested on NVIDIA either.
 RUN python3 -m pip uninstall py3nvml pynvml nvidia-ml-py apex -y
+
+# `kernels` may causes many failing tests
+RUN python3 -m pip uninstall -y kernels
\ No newline at end of file

filename: docker/transformers-pytorch-deepspeed-amd-gpu/Dockerfile
patch: @@ -48,3 +48,6 @@ RUN python3 -c "from deepspeed.launcher.runner import main"
 
 # Remove nvml as it is not compatible with ROCm
 RUN python3 -m pip uninstall py3nvml pynvml nvidia-ml-py apex -y
+
+# `kernels` may causes many failing tests
+RUN python3 -m pip uninstall -y kernels
Repository: nodejs/node
Pull request: src: add nullptr handling for `NativeKeyObject`

Fixes: #56899

Changed files:
filename: src/crypto/crypto_keys.cc
patch: @@ -1045,6 +1045,7 @@ void NativeKeyObject::New(const FunctionCallbackInfo<Value>& args) {
   CHECK_EQ(args.Length(), 1);
   CHECK(args[0]->IsObject());
   KeyObjectHandle* handle = Unwrap<KeyObjectHandle>(args[0].As<Object>());
+  CHECK_NOT_NULL(handle);
   new NativeKeyObject(env, args.This(), handle->Data());
 }
Repository: electron/electron
Pull request: build: update appveyor image to latest version

This PR updates appveyor.yml to the latest baked image, e-132.0.6781.0.

Notes: none

Changed files:
filename: appveyor-woa.yml
patch: @@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-131.0.6734.0-node-20.17-0
+image: e-132.0.6781.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default

filename: appveyor.yml
patch: @@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-131.0.6734.0-node-20.17-0
+image: e-132.0.6781.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default
Repository: huggingface/transformers
Pull request: Hot fix for AMD CI workflow

# What does this PR do?

I made a mistake in #38298 and the slack reports is broken for AMD at this moment due to a dict key error.

We should access `event_payload["workflow_run"]["event"]` instead where `event_payload` looks like


```python
{
  "action": "completed",
  "workflow": {
    "created_at": "2024-04-23T08:01:31.000Z",
    "html_url": "https://github.com/ydshieh/transformers/blob/main/.github/workflows/self-scheduled-amd-caller.yml",
    "id": 95041645,
    "name": "Self-hosted runner (AMD scheduled CI caller)",
    "node_id": "W_kwDOEW1XxM4Fqjht",
    "path": ".github/workflows/self-scheduled-amd-caller.yml",
    "state": "active",
    "updated_at": "2025-05-23T12:11:50.000Z",
    "url": "https://api.github.com/repos/ydshieh/transformers/actions/workflows/95041645"
  },
  "workflow_run": {
    "actor": {
      "html_url": "https://github.com/ydshieh",
      "id": 2521628,
      "login": "ydshieh",
    },
    "artifacts_url": "https://api.github.com/repos/ydshieh/transformers/actions/runs/15211635268/artifacts",
    "cancel_url": "https://api.github.com/repos/ydshieh/transformers/actions/runs/15211635268/cancel",
    "conclusion": "success",
    "created_at": "2025-05-23T13:37:05Z",
    "display_title": "Self-hosted runner (AMD scheduled CI caller)",
    "event": "schedule",
    "head_branch": "main",
    "head_commit": {
      "author": {
        "email": "2521628+ydshieh@users.noreply.github.com",
        "name": "Yih-Dar"
      }
    },
    "updated_at": "2025-05-23T13:37:12Z",
    "url": "https://api.github.com/repos/ydshieh/transformers/actions/runs/15211635268",
    "workflow_id": 95041645,
    "workflow_url": "https://api.github.com/repos/ydshieh/transformers/actions/workflows/95041645"
  }
}
```

Changed files:
filename: utils/notification_service.py
patch: @@ -1313,7 +1313,7 @@ def pop_default(l: list[Any], i: int, default: Any) -> Any:
             event_payload = json.load(fp)
             # The event that triggers the `workflow_run` event.
             if "workflow_run" in event_payload:
-                is_scheduled_ci_run = event_payload["event"] == "schedule"
+                is_scheduled_ci_run = event_payload["workflow_run"]["event"] == "schedule"
 
     # The values are used as the file names where to save the corresponding CI job results.
     test_to_result_name = {
Repository: ggml-org/llama.cpp
Pull request: cmake: remove shader-gen step-targets from ggml-vulkan

The build/install steps of vulkan-shaders-gen are an implementation detail, but they are included as dependencies for ggml-vulkan. This removes such dependency so vulkan-shaders-gen doesn't get installed with the top-level "make install".

In addition it fixes an issue when the DESTDIR is specified for a Makefile generator when "make install" triggers the build step.

Changed files:
filename: ggml/src/ggml-vulkan/CMakeLists.txt
patch: @@ -144,9 +144,15 @@ if (Vulkan_FOUND)
                    ${VULKAN_SHADER_GEN_CMAKE_ARGS}
 
         BUILD_COMMAND   ${CMAKE_COMMAND} --build   . --config $<CONFIG>
-        INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config $<CONFIG>
+
+        # NOTE: When DESTDIR is set using Makefile generators and
+        # "make install" triggers the build step, vulkan-shaders-gen
+        # would be installed into the DESTDIR prefix, so it is unset
+        # to ensure that does not happen.
+
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E env --unset=DESTDIR
+                        ${CMAKE_COMMAND} --install . --config $<CONFIG>
     )
-    ExternalProject_Add_StepTargets(vulkan-shaders-gen build install)
 
     set (_ggml_vk_host_suffix $<IF:$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>,.exe,>)
     set (_ggml_vk_genshaders_dir "${CMAKE_BINARY_DIR}/$<CONFIG>")
@@ -172,8 +178,6 @@ if (Vulkan_FOUND)
 
         DEPENDS ${_ggml_vk_shader_files}
                 vulkan-shaders-gen
-                vulkan-shaders-gen-build
-                vulkan-shaders-gen-install
 
         COMMENT "Generate vulkan shaders"
     )
Repository: nodejs/node
Pull request: test: ensure that test priority is not higher than current priority

This test fails if parent's (e.g. `sshd`) niceness is already lower than `10` and we're not root.

Changed files:
filename: test/parallel/test-os.js
patch: @@ -83,11 +83,12 @@ assert.ok(hostname.length > 0);
 
 // IBMi process priority is different.
 if (!common.isIBMi) {
-  const DUMMY_PRIORITY = 10;
-  os.setPriority(DUMMY_PRIORITY);
+  const { PRIORITY_BELOW_NORMAL, PRIORITY_LOW } = os.constants.priority;
+  const LOWER_PRIORITY = os.getPriority() > PRIORITY_BELOW_NORMAL ? PRIORITY_BELOW_NORMAL : PRIORITY_LOW;
+  os.setPriority(LOWER_PRIORITY);
   const priority = os.getPriority();
   is.number(priority);
-  assert.strictEqual(priority, DUMMY_PRIORITY);
+  assert.strictEqual(priority, LOWER_PRIORITY);
 }
 
 // On IBMi, os.uptime() returns 'undefined'
Repository: ggml-org/llama.cpp
Pull request: batch : fix check for empty sequences in memory

ref https://github.com/ggml-org/llama.cpp/pull/14217#issuecomment-3000665835

Changed files:
filename: src/llama-batch.cpp
patch: @@ -244,19 +244,21 @@ bool llama_batch_allocr::init(
             continue;
         }
 
-        if (memory) {
+        const llama_pos p0 = memory ? memory->seq_pos_max(s) : -1;
+
+        if (p0 >= 0) {
             bool ok = true;
 
             if (batch.token) {
-                if (seq_pos_min(s) != memory->seq_pos_max(s) + 1) {
+                if (seq_pos_min(s) != p0 + 1) {
                     ok = false;
                 }
             } else {
                 assert(batch.embd);
 
                 // for embeddings (typically used as vision input), we allow them to have repeating positions
                 // ref: https://github.com/ggml-org/llama.cpp/issues/13694#issuecomment-2983871762
-                if (seq_pos_min(s) != memory->seq_pos_max(s) && seq_pos_min(s) != memory->seq_pos_max(s) + 1) {
+                if (seq_pos_min(s) != p0 && seq_pos_min(s) != p0 + 1) {
                     ok = false;
                 }
             }
@@ -267,7 +269,7 @@ bool llama_batch_allocr::init(
                         " - the last position stored in the memory module of the context (i.e. the KV cache) for sequence %d is X = %d\n"
                         " - the tokens for sequence %d in the input batch have a starting position of Y = %d\n"
                         " it is required that the sequence positions remain consecutive: Y = X + 1\n",
-                        __func__, s, s, memory->seq_pos_max(s), s, seq_pos_min(s));
+                        __func__, s, s, p0, s, seq_pos_min(s));
 
                 return false;
             }
Repository: electron/electron
Pull request: fix: Linux crash after `webContents.print()` with no parent window

Backport of #44246

See that PR for details.


Notes: Fixed an issue where closing a window after printing on Linux triggered a crash.


Changed files:
filename: patches/chromium/printing.patch
patch: @@ -949,3 +949,23 @@ index e89fd87753bad3c5663fa53f8dcc4542e7e307e5..2b433a0705234af6f9808ee741a9795d
  namespace sandbox::policy {
  
  base::FilePath GetCanonicalPath(const base::FilePath& path) {
+diff --git a/ui/gtk/gtk_util.cc b/ui/gtk/gtk_util.cc
+index d86fbcf969f2fa0d176ead903703ab612e5464c2..6b963ea8401d20e655d068a69105586814bab320 100644
+--- a/ui/gtk/gtk_util.cc
++++ b/ui/gtk/gtk_util.cc
+@@ -227,9 +227,13 @@ aura::Window* GetAuraTransientParent(GtkWidget* dialog) {
+ }
+ 
+ void ClearAuraTransientParent(GtkWidget* dialog, aura::Window* parent) {
++  if (!parent || !parent->GetHost()) {
++    return;
++  }
++
+   g_object_set_data(G_OBJECT(dialog), kAuraTransientParent, nullptr);
+-  GtkUi::GetPlatform()->ClearTransientFor(
+-      parent->GetHost()->GetAcceleratedWidget());
++  gfx::AcceleratedWidget parent_id = parent->GetHost()->GetAcceleratedWidget();
++  GtkUi::GetPlatform()->ClearTransientFor(parent_id);
+ }
+ 
+ base::OnceClosure DisableHostInputHandling(GtkWidget* dialog,