[gnome-shell] background: Don't silently fizzle out when removing bad content from the cache
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] background: Don't silently fizzle out when removing bad content from the cache
- Date: Wed, 4 Dec 2013 00:23:22 +0000 (UTC)
commit 7249b118993474b7e6358f82e872d7735154e796
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Dec 3 17:54:02 2013 -0500
background: Don't silently fizzle out when removing bad content from the cache
If the background is already removed, or we're trying to remove bad content,
this is probably a bug in content accounting, so let us crash so we can fix
the bugs.
https://bugzilla.gnome.org/show_bug.cgi?id=719803
js/ui/background.js | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 885e96b..a56a0af 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -113,9 +113,9 @@ const BackgroundCache = new Lang.Class({
_removeContent: function(contentList, content) {
let index = contentList.indexOf(content);
-
- if (index >= 0)
- contentList.splice(index, 1);
+ if (index < 0)
+ throw new Error("Trying to remove invalid content: " + content);
+ contentList.splice(index, 1);
},
removePatternContent: function(content) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]