这是代码:
if article.link && article.link.starts_with?(`https://www.youtube.com`) then article.link end
该错误涉及此部分:
article.link.starts_with?(`https://www.youtube.com`)
但是,如果article.link为nil,则甚至不应该评估该部分。
答案 0 :(得分:1)
如果问题出在org.omg.CORBA.MARSHAL: Buffer overread by 4 bytes
at org.openorb.io.AbstractInputStream.next(Unknown Source)
at org.openorb.iiop.CDRInputStream.read_long(Unknown Source)
at org.openorb.iiop.CDRInputStream.read_ulong(Unknown Source)
at org.openorb.iiop.CDRInputStream.read_wstring(Unknown Source)
at imap.TraceService.TraceTask_THelper.read(Unknown Source)
at imap.TraceService._TraceService_ITFStub.getTaskById(Unknown Source)
,则错误将是article.link
实际上,问题出在NoMethodError: undefined method `starts_with?' for nil:NilClass
表达式上。计算结果为https://www.youtube.com
。为什么使用这些报价?将它们更改为nil
或""