Setting timeScale to 0 causing editor to freeze

I’m using this script I wrote a while back, but for some reason occasionally the editor and game completely freezes and I can’t un pause. This use to work fine for a while, but not it freezes causing me to force quit Unity. Any ideas why this may be occurring?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PauseMenu : MonoBehaviour {
	public static bool GameIsPaused = false;

	public GameObject pauseMenuUI;

	// Update is called once per frame
	void Update () {
		if (Input.GetKeyDown(KeyCode.Escape))
			if (GameIsPaused)
			} else
	void Resume ()
		Time.timeScale = 1f;
		GameIsPaused = false;
		Cursor.visible = false;
		AudioListener.pause = false;
	void Pause ()
		Time.timeScale = .0f;
		GameIsPaused = true;
		Cursor.visible = true;
		AudioListener.pause = true;

HI man, have same issue, did you manage to find solution for this? My temporary fix was changing Time.timeScale = .01f; but hope it’s not final solution