Fix log crash when defIm

Change-Id: Ib57935e939f6a870a8dfdc4569184499849a7348