2010-05-18 22 views
0

這段代碼(Scala中)SWT複合構造拋出:IllegalArgumentException - 在非空參數

val contents = { 
    assert(mainWindow.detailsPane != null) 
    new Composite(mainWindow.detailsPane, SWT.NONE) 
} 

拋出異常:

Exception occurred 
java.lang.IllegalArgumentException: Argument not valid 
    at org.eclipse.swt.SWT.error(Unknown Source) 
    at org.eclipse.swt.SWT.error(Unknown Source) 
    at org.eclipse.swt.SWT.error(Unknown Source) 
    at org.eclipse.swt.widgets.Widget.error(Unknown Source) 
    at org.eclipse.swt.widgets.Widget.checkParent(Unknown Source) 
    at org.eclipse.swt.widgets.Widget.<init>(Unknown Source) 
    at org.eclipse.swt.widgets.Control.<init>(Unknown Source) 
    at org.eclipse.swt.widgets.Scrollable.<init>(Unknown Source) 
    at org.eclipse.swt.widgets.Composite.<init>(Unknown Source) 
    at main.scala.NodeViewPresenter$NodeViewImpl.<init>(NodeViewPresenter.scala:41) 

按照documentationIllegalArgumentException應該只被拋出當父母是null,但我正在檢查。 detailsPaneCTabFolder。爲什麼會發生?

+0

我並沒有將其標記爲斯卡拉,因爲我認爲這是一個純粹的SWT的問題(這被證明是正確的)。 – 2010-05-18 09:33:54

回答

1

您是否檢查widget是否被丟棄?

編輯:沒有看到你的答案有;)

相關問題