From 373b7ba2937571331a7e4c55bf625ac618cd0c2f Mon Sep 17 00:00:00 2001 From: "Wilma456 (Jakob0815)" Date: Tue, 12 Sep 2017 17:17:58 +0200 Subject: [PATCH] Fix check of write() if you call write(nil), you will get the error "bios.lua:229: bad argument: string expected, got nil", so nil is not a valid argument for write() and should be removed. --- src/main/resources/assets/computercraft/lua/bios.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/computercraft/lua/bios.lua b/src/main/resources/assets/computercraft/lua/bios.lua index 3f13e26c3..1b06ac3a2 100644 --- a/src/main/resources/assets/computercraft/lua/bios.lua +++ b/src/main/resources/assets/computercraft/lua/bios.lua @@ -206,8 +206,8 @@ function sleep( nTime ) end function write( sText ) - if sText ~= nil and type( sText ) ~= "string" and type( sText ) ~= "number" then - error( "bad argument #1 (expected string, got " .. type( sText ) .. ")", 2 ) + if type( sText ) ~= "string" and type( sText ) ~= "number" then + error( "bad argument #1 (expected string or number, got " .. type( sText ) .. ")", 2 ) end local w,h = term.getSize()