ppy/osu · warning · ArgumentException

At least one value expected!

Error message

At least one value expected!

What it means

Thrown as ArgumentException by the ProfileLineChart.Values setter when the assigned array is empty. The chart needs at least one data point to compute axes and ticks, so an empty input is rejected at the boundary.

Source

Thrown at osu.Game/Overlays/Profile/Sections/Historical/ProfileLineChart.cs:30:30

        public APIUserHistoryCount[] Values
        {
            get => values;
            set
            {
                if (value.Length == 0)
                    throw new ArgumentException("At least one value expected!", nameof(value));

                graph.Values = values = value;

                createRowTicks();
                createColumnTicks();
            }
        }

View on GitHub (pinned to d9c73e12ad)

Solutions

  1. Check the array is non-empty before assigning; hide/disable the chart when empty.
  2. Gate rendering on values.Length > 0 and show an empty-state placeholder instead.
  3. Ensure upstream filtering does not strip all data points.

Example fix

// before
chart.Values = history.ToArray();

// after
if (history.Any())
    chart.Values = history.ToArray();
else
    chart.Hide();
Defensive patterns

Strategy: validation

Validate before calling

if (history.Length > 0)
    chart.Values = history;
else
    chart.Hide();

Type guard

bool HasData(APIUserHistoryCount[] values) => values.Length > 0;

Try / catch

try { chart.Values = values; }
catch (ArgumentException) { /* empty dataset: hide the chart */ }

Prevention

When it happens

Trigger: Setting ProfileLineChart.Values to an APIUserHistoryCount[] of length 0. Happens when the user profile's historical data (e.g. play count history) returned no points.

Common situations: New or inactive user with no historical plays; API returned an empty history array; filtering removed all points before binding.

Related errors


AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13). Data as JSON: /api/errors/7f3caeb3673869d0. Report an issue: GitHub.