#2503 JS: fwt::Tab.image

SlimerDude Wed 6 Jan 2016

fwt::Tab.image throws an Err when it is set to null. The following null check prevents that:

diff -r dcdb455f1605 src/fwt/js/TabPeer.js
--- a/src/fwt/js/TabPeer.js	Tue Jan 05 20:12:01 2016 -0500
+++ b/src/fwt/js/TabPeer.js	Thu Jan 07 00:18:07 2016 +0000
@@ -21,7 +21,10 @@
 fan.fwt.TabPeer.prototype.image$ = function(self, val)
 {
   this.m_image = val;
-  fan.fwt.FwtEnvPeer.loadImage(val, self)
+  if (val != null)
+  {
+    fan.fwt.FwtEnvPeer.loadImage(val, self)
+  }
 }
 
 fan.fwt.TabPeer.prototype.m_$defCursor = "default";

It could be argued that loadImage() should do the null check, but the patch just follows what Label.image does.

andy Thu 7 Jan 2016

Yeah thats fine - thanks - fixed

Login or Signup to reply.