mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
layout: Range-check index before array lookup
findMonitorForActor() may be called before the layoutManager gets to initialize monitors, so make sure the monitor index is in range to avoid a warning. https://bugzilla.gnome.org/show_bug.cgi?id=781471
This commit is contained in:
parent
f33560f014
commit
1ba014d9db
1 changed files with 4 additions and 1 deletions
|
|
@ -896,7 +896,10 @@ const LayoutManager = new Lang.Class({
|
|||
},
|
||||
|
||||
findMonitorForActor: function(actor) {
|
||||
return this.monitors[this.findIndexForActor(actor)];
|
||||
let index = this.findIndexForActor(actor);
|
||||
if (index >= 0 && index < this.monitors.length)
|
||||
return this.monitors[index];
|
||||
return null;
|
||||
},
|
||||
|
||||
_queueUpdateRegions: function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue