[Bbs2ch-cvs 345] [327] 引数の NULL チェックを追加

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 1月 20日 (日) 17:59:08 JST


Revision: 327
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=327
Author:   flyson
Date:     2008-01-20 17:59:07 +0900 (Sun, 20 Jan 2008)

Log Message:
-----------
引数の NULL チェックを追加

Modified Paths:
--------------
    trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalThreadUtils.js


-------------- next part --------------
Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalThreadUtils.js
===================================================================
--- trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalThreadUtils.js	2008-01-19 17:39:14 UTC (rev 326)
+++ trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalThreadUtils.js	2008-01-20 08:59:07 UTC (rev 327)
@@ -52,6 +52,10 @@
 b2rGlobalThreadUtils.prototype = {
 
 	getBoardType: function(aThreadURL){
+		if(aThreadURL === null){
+			throw Components.results.NS_ERROR_NULL_POINTER;
+		}
+
 			// HTTP ˆÈŠO
 		if(aThreadURL.scheme != "http") return Ci.b2rIGlobalService.BOARD_TYPE_PAGE;
 			// HOST ‚¾‚¯‚Ì URL
@@ -80,6 +84,10 @@
 
 
 	getBoardID: function(aBoardURL){
+		if(aBoardURL === null){
+			throw Components.results.NS_ERROR_NULL_POINTER;
+		}
+
 		var boardID = "/";
 		if(aBoardURL.host.indexOf(".2ch.net")!=-1){
 			boardID += "2ch" + aBoardURL.path;
@@ -98,6 +106,10 @@
 
 
 	getBoardURL: function(aURL){
+		if(aURL === null){
+			throw Components.results.NS_ERROR_NULL_POINTER;
+		}
+
 		var boardURLSpec = aURL.resolve("../");
 
 		switch(this.getBoardType(aURL)){


bbs2ch-cvs メーリングリストの案内
Back to archive index