fix io.format nil index  exception

fix index nil.RegisterExtension err