@@ -292,7 +292,7 @@ module.removeSpace = function(...)
292
292
_BE_DANGEROUS_FLAG_ = _Are_We_Being_Dangerous_
293
293
-- check for windows which need to be moved
294
294
local theWindows = {}
295
- for i , v in ipairs (module .allWindowsForSpace (spaceID )) do table.insert (theWindows , v :id ()) end
295
+ for i , v in ipairs (module .allWindowsForSpace (spaceID )) do if v : id () then table.insert (theWindows , v :id ()) end end
296
296
297
297
-- get id of screen to move them to
298
298
local baseID = 0
@@ -368,9 +368,11 @@ module.allWindowsForSpace = function(...)
368
368
end
369
369
local realWindowIDs = {}
370
370
for i ,v in ipairs (windowIDs ) do
371
- for j ,k in ipairs (internal .windowsOnSpaces (v :id ())) do
372
- if k == spaceID then
373
- table.insert (realWindowIDs , v )
371
+ if v :id () then
372
+ for j ,k in ipairs (internal .windowsOnSpaces (v :id ())) do
373
+ if k == spaceID then
374
+ table.insert (realWindowIDs , v )
375
+ end
374
376
end
375
377
end
376
378
end
@@ -519,10 +521,13 @@ screenMT.__index.spaces = function(obj) return module.spacesByScreenUUI
519
521
screenMT .__index .spacesUUID = internal .UUIDforScreen
520
522
screenMT .__index .spacesAnimating = function (obj ) return internal .screenUUIDisAnimating (internal .UUIDforScreen (obj )) end
521
523
522
- windowMT .__index .spaces = function (obj ) return internal .windowsOnSpaces (obj :id ()) end
524
+ windowMT .__index .spaces = function (obj ) return obj : id () and internal .windowsOnSpaces (obj :id ()) or nil end
523
525
windowMT .__index .spacesMoveTo = function (obj , ...)
524
- module .moveWindowToSpace (obj :id (), ... )
525
- return obj
526
+ if obj :id () then
527
+ module .moveWindowToSpace (obj :id (), ... )
528
+ return obj
529
+ end
530
+ return nil
526
531
end
527
532
528
533
-- add raw subtable if the user has enabled it
0 commit comments