summaryrefslogtreecommitdiff
path: root/libgo/runtime/cpuprof.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/cpuprof.c')
-rw-r--r--libgo/runtime/cpuprof.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/runtime/cpuprof.c b/libgo/runtime/cpuprof.c
index a2a1a05ce3d..a07029c4c4f 100644
--- a/libgo/runtime/cpuprof.c
+++ b/libgo/runtime/cpuprof.c
@@ -177,7 +177,7 @@ runtime_SetCPUProfileRate(intgo hz)
runtime_noteclear(&prof->wait);
runtime_setcpuprofilerate(tick, hz);
- } else if(prof->on) {
+ } else if(prof != nil && prof->on) {
runtime_setcpuprofilerate(nil, 0);
prof->on = false;