object: Avoid segfault in debug mode

This null pointer access could only happen when debug logging was turned
on, but nonetheless it can be avoided easily.
19 jobs for remove-get-set-property-hooks in 44 minutes and 20 seconds (queued for 7 seconds)
Status Job ID Name Coverage
  Source Check
passed #40255
cppcheck

00:08:20

passed #40256
cpplint

00:00:54

passed #40257
eslint

00:01:56

passed #40271
fedora

00:02:29

failed #40254
fedora

00:00:06

 
  Test
passed #40273
fedora_clang

00:04:42

failed #40258
fedora_clang

00:00:11

 
  Thorough Tests
passed #40261
coverage

00:30:54

passed #40260
installed_tests

00:01:44

manual #40266
allowed to fail manual
lts
manual #40265
allowed to fail manual
no_graphics
passed #40259
no_profiler

00:03:55

passed #40262
sanitizer_gcc

00:04:00

manual #40264
allowed to fail manual
valgrind
passed #40263
with_logging

00:02:24

manual #40269
allowed to fail manual
zeal_11
manual #40267
allowed to fail manual
zeal_2
manual #40268
allowed to fail manual
zeal_4
 
  Delivery
manual #40270
allowed to fail manual
packaging