|[Acceleo] How to test for empty/null reference? [message #639585]
||Wed, 17 November 2010 03:08
| Glenview Jeff
Registered: September 2010
This should be a really easy question to answer, but I can't figure it out from the Acceleo manual.|
I can't figure out how to test for a null reference so I can skip it. I have some code that iterates through a structure. The top level type is called an Activity and it contains a reference 0..1 of menu. Not all activities have menus in the model and thus I get the error I pasted below the code.
Thanks for your help!
line 8: [for (anActivity : Activity | myActivities.activities)]
line 9: [for (aMenu : Menu | anActivity.menu)]
Invalid loop iteration at line 9 in Module Strings for block for (anActivity.menu.items). Last recorded value of self was flashcards.activities.impl.AnyMemoImpl@14c816b (name: AnyMemo).
Powered by FUDForum
. Page generated in 0.11337 seconds