Skip to content

Commit

Permalink
check resource after injected.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Oct 17, 2024
1 parent a847b0f commit fa251e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ module.exports.inject = function (filename, resourceName, resourceData, options)
}

const buffer = Buffer.from(data.buffer);
const checkResource = buffer.indexOf(resourceData);
if (checkResource === -1) {
throw new Error("Resource was not injected correctly");
}

const firstSentinel = buffer.indexOf(sentinelFuse);

if (firstSentinel === -1) {
Expand Down

0 comments on commit fa251e2

Please sign in to comment.