Fix fatal error when trying to open a non existing public link

Found while testing https://github.com/owncloud/apps/pull/1476

cc @karlitschek @DeepDiver1975