Fixed variable type.

PHP Notice: Trying to get property of non-objectの修正