Cannot read property ‘post_id’ of null ACF plugin error

This error occurs on wp admin and causes disabling of theme customiser.

To solve, open unminified version of js file — input.js inside ACF plugin’s folder, find line 987 and add the code, so the result looked like this:

$(document).ready(function(){
		
		/* added this condition, since acf.o was null at certain points for some reason when in the admin backend */
		if (acf.o == null) {
			return;
		}
		
		// update post_id
		acf.screen.post_id = acf.o.post_id;
		acf.screen.nonce = acf.o.nonce;

Then minify the js code via minifier (for example this one: https://javascript-minifier.com/, copy and replace the content of input.min.js, upload to server plugin’s folder and voila.