Helper method to throw exception if a provided layout-data is null or not a LithoLayoutData instance. Will return a casted, non-null instance of LithoLayoutData otherwise.