use isset to prevent undefined index

@blizzz @icewind1991 @karlitschek @butonic THX

backport to stable5 required as well