Skip to content

Commit b160525

Browse files
committed
Update device.jl
Consider `nothing` backend for example `WGPUCompute` doesnot have GUI backend.
1 parent ce09244 commit b160525

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/device.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ end
125125
function getDefaultDevice(canvas; backendType = getDefaultBackendType())
126126
adapter = WGPUCore.requestAdapter(;canvas=canvas)
127127
device = requestDevice(adapter)
128-
canvas.device = device
128+
if canvas != nothing
129+
canvas.device = device
130+
end
129131
return device
130132
end

0 commit comments

Comments
 (0)