Repository: UKGovernmentBEIS/inspect_ai
Issue: An unexpected error occured in viewer when refocusing it using a multi scorer and nan as potential scores.
Root cause: Validation Gap

I am running an evaluation using [a scorer with multiple values](https://inspect.aisi.org.uk/scorers.html#scorer-with-multiple-values), and some of the individual scores can be `NaN`.

<details><summary>Example Code</summary>

```python
import numpy as np
from inspect_ai import Task
from inspect_ai import task
from inspect_ai.dataset import Sample
from inspect_ai.scorer import Score, accuracy
from inspect_ai.scorer import Scorer
from inspect_ai.scorer import Target
from inspect_ai.scorer import scorer
from inspect_ai.solver import TaskState
from inspect_ai.solver import generate


@scorer(metrics={"one": [accuracy()], "two": [accuracy()]})
def _scorer() -> Scorer:
    """Create a multi-scorer that avoids ordering issues of separate solvers.

    The problem is that the solvers are executed in parallel and the order of the
    solvers is not guaranteed. This can lead to the overlap solver being executed before
    the validation solver. This can lead to a KeyError if the metadata is not set yet.

    """

    async def score(state: TaskState, target: Target) -> Score:  # noqa: ARG001
        return Score(value={"one": np.nan, "two": np.nan})
    return score


@task
def hello_world():
    return Task(
        dataset=[
            Sample(
                input="Just reply with Hello World",
                target="Hello World",
            )
        ],
        solver=[
            generate(),
        ],
        scorer=_scorer(),
    )

```

</details>

Running the evaluation yields a log that can be viewed. But, when you switch to another vscode tab (no split view) and return to the log tab you see the following error message.

![Image](https://github.com/user-attachments/assets/100b9957-4df9-48ef-972f-5132e77a01e9)

<details><summary>Plain Text Error</summary>

```plain
An unexpected error occurred.

Error: Cannot read properties of null (reading 'toString')
at TypeError: Cannot read properties of null (reading 'toString')
    at formatPrettyDecimal (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:19734:37)
    at https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:74269:125
    at Array.forEach (<anonymous>)
    at ScoreGrid (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:74264:20)
    at renderWithHooks (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:3534:25)
    at updateFunctionComponent (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:5031:20)
    at beginWork (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:5686:18)
    at performUnitOfWork (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:8751:18)
    at workLoopSync (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site-packages/inspect_ai/_view/www/dist/assets/index.js:8650:41)
    at renderRootSync (https://file+.vscode-resource.vscode-cdn.net/Users/project/.pixi/envs/default/lib/python3.12/site
```

</details>

The version is v0.3.90.