[polari] chatView: Don't access unset property
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] chatView: Don't access unset property
- Date: Fri, 17 Feb 2017 22:36:19 +0000 (UTC)
commit cde6b66ed2a49e29c0e540b0d6b856ebb543d585
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Feb 16 20:08:43 2017 +0100
chatView: Don't access unset property
We attach a timestamp of the last activity to nick tags to decide
whether to show corresponding status messages or not. However
this monkey-patched property is unset if there hasn't been any
activity from the nick - make sure to handle that case properly
instead of using an undefined value in a computation.
https://bugzilla.gnome.org/show_bug.cgi?id=778793
src/chatView.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 8f9de8e..2ca8d9a 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1031,7 +1031,7 @@ const ChatView = new Lang.Class({
_shouldShowStatus: function(nick) {
let nickTag = this._lookupTag('nick' + nick);
- if (!nickTag)
+ if (!nickTag || !nickTag._lastActivity)
return false;
let time = GLib.get_monotonic_time();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]