Fix null reference exception during "kpm pack --runtime"