Site Options `/keep` request returns 500

Having a hard time tracking down the source of this—I can reproduce this 500 error (with a variety of messages) in the last few versions, but for reference, this is with the 2.5.5 starter kit:

When editing Site Options, un-saved changes (as usual) trigger a request to /panel/site/keep. That request comes back as a 500: Undefined variable: store in file: /Users/my-username/Sites/my-site-name/app/panel/app/src/panel/models/page/changes.php on line: 112. This method, for reference:

class Changes {
  // ...
  public function update($field, $data = null) {
    if(is_null($data) and is_array($field)) {
      $store = $this->data();
      $store[$this->id()] = $field;
    } else if(is_string($field)) {
      $store = $this->data();
      if(!isset($store[$this->id()]) or !is_array($store[$this->id()])) {
        $store[$this->id()] = array();
      $store[$this->id()][$field] = $data;      

    s::set('kirby_panel_changes', $store);
    return $store;
  // ...

It sounds like Kirby is unable to properly set $store within Changes::update—there are some circumstances where it would be undefined, but I’m not familiar enough with how this is called (or, passed data) to understand what data is potentially missing from the request.

Normal page keep requests work fine, so there must be some difference in this method’s behavior when attached to a page vs. site.

Any ideas? Wanted to post here before creating an issue, in case I’m not thinking of an obvious solution.

Addendum: I’m curious if this might have some bearing on another issue, whereby values in Site Options aren’t persisted after a save. Is there any relationship between keep data and the data that is actually saved? Could a failed call to keep later cause data to revert (since it wasn’t actually cached, the first time)?

I can reproduce this, at least the part with the call to keep.

As regards persisting of data, since the call to keep fails, data is not persisted if you leave the page or upload an image. If you just hit save without leaving the page or uploading an image, data is stored as expected.