silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
719 stars 820 forks source link

FIX Invoke method addHeader on NULL #11075

Closed sabina-talipova closed 7 months ago

sabina-talipova commented 7 months ago

Description

Check that $controller->getResponse() is not NULL before invoke addHeader on it.

Parent issue

sabina-talipova commented 7 months ago

This issue happens now only in CI and related to this PR. I just might assume that something happens in mock controller. I think, if we add $controllerMock->method('getResponse')->willReturn('test'); probably also solve the problem, but I think just in case would be better to check that we have response before. I'll open PR for ckan-registry as well.

emteknetnz commented 7 months ago

Sorry I mean can you link to the broken build in CI?

sabina-talipova commented 7 months ago

Oh, sorry. Here it is https://github.com/silverstripe/silverstripe-ckan-registry/actions/runs/7019350079/job/19122212114

emteknetnz commented 7 months ago

Better to fix on ckan registry directly. Closing this PR in favor of https://github.com/silverstripe/silverstripe-ckan-registry/pull/305