We never want to return a sharedfile without an owner

This commit is contained in:
Alex Corn 2023-06-24 02:43:09 -04:00
parent 36e8c79d87
commit bde2cafaf4
No known key found for this signature in database
GPG Key ID: E51989A3E7A27FDF

View File

@ -137,10 +137,13 @@ SteamCommunity.prototype.getSteamSharedFile = function(sharedFileId, callback) {
let ownerHref = $(".friendBlockLinkOverlay").attr()["href"];
Helpers.resolveVanityURL(ownerHref, (err, data) => { // This request takes <1 sec
if (!err) {
sharedfile.owner = new SteamID(data.steamID);
if (err) {
callback(err);
return;
}
sharedfile.owner = new SteamID(data.steamID);
// Make callback when ID was resolved as otherwise owner will always be null
callback(null, new CSteamSharedFile(this, sharedfile));
});