[Title] exception when nil in build comm
authorjiil.hyoun <jiil.hyoun@samsung.com>
Mon, 24 Dec 2012 02:07:12 +0000 (11:07 +0900)
committerjiil.hyoun <jiil.hyoun@samsung.com>
Mon, 24 Dec 2012 02:07:12 +0000 (11:07 +0900)
[Type] Bugfix
[Module] Toolchain /
[Priority] Minor
[Jira#]
[Redmine#]  7858
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: I059ff1c21eb0679a92a1710046523a9baf624505

src/build_server/SocketJobRequestListener.rb

index ae6e0d86147fec8757940e6c26a7aa1454f8ada6..d06f0d692f0a37d01aaa17d515fdb41f8e8968ee 100644 (file)
@@ -196,8 +196,8 @@ class SocketJobRequestListener
                os_list = tok[4].split(",")
                async = tok[5].eql? "YES"
                no_reverse = tok[6].eql? "YES"
-               dist_name = tok[7].strip
-               user_email = tok[8].strip
+               dist_name = (not tok[7].nil? and not tok[7].empty?) ? tok[7].strip : ""
+               user_email = (not tok[8].nil? and not tok[8].empty?) ? tok[8].strip : ""
                verbose = tok[9].eql? "YES"
                is_internal = tok[10].eql? "YES"
                rev_job = tok[11].eql? "YES"
@@ -388,7 +388,7 @@ class SocketJobRequestListener
                        os=tok[4]
                        async = tok[5].eql? "YES"
                        dist_name = tok[6]
-                       user_email = tok[7].strip
+                       user_email = (not tok[7].nil? and not tok[7].empty?) ? tok[7].strip : ""
                        verbose = tok[8].eql? "YES"
                        if (dist_name.nil? or dist_name.empty?) then
                                dist_name = @parent_server.distmgr.get_default_distribution_name()
@@ -786,7 +786,7 @@ class SocketJobRequestListener
                        passwd = tok[3]
                        dock = (tok[4].nil? or tok[4].empty?) ? "0" : tok[4].strip
                        dist_name = tok[5]
-                       user_email = tok[6].strip
+                       user_email = (tok[7].nil? or tok[7].empty?) ? "" : tok[6].strip
                        no_reverse = tok[7].eql? "YES"
 
                        if (dist_name.nil? or dist_name.empty?) then
@@ -869,7 +869,7 @@ class SocketJobRequestListener
                        raise "Invalid request format is used: #{line}"
                end
 
-               dock_num = tok[1].strip
+               dock_num = (tok[1].nil? or tok[1].empty?) ? "0" : tok[1].strip
 
                BuildCommServer.send_begin(req)
                incoming_dir = "#{@parent_server.transport_path}/#{dock_num}"
@@ -889,7 +889,7 @@ class SocketJobRequestListener
                        raise "Invalid request format is used: #{line}"
                end
 
-               dock_num = tok[1].strip
+               dock_num = (tok[1].nil? or tok[1].empty?) ? "0" : tok[1].strip
                file_name = tok[2]
 
                @log.info "Received a request for download file : #{file_name}"