# HG changeset patch # User jittat # Date 2008-03-10 15:47:19 # Node ID 5bcf18c63ae46dd500864361cafe193de6e38ff1 # Parent 0bbd9fb65914d9734643ed63b167c8c204256353 fix bug: test_request: read empty output file git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@102 6386c4cd-e34a-4fa8-8920-d93eb39b512e diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb --- a/app/controllers/test_controller.rb +++ b/app/controllers/test_controller.rb @@ -31,6 +31,9 @@ end if test_request.output_file_name!=nil data = File.open(test_request.output_file_name).read(2048) + if data==nil + data="" + end send_data(data, {:filename => 'output.txt', :type => 'text/plain'})