Fix possible NPE when initializing object

Fix PLF-3727