Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public Plugin(File pluginCommitDescriptor) throws IOException, DisabledPluginExc
}

commit = (String) cd.remove("commit");
if (!COMMIT_TEST.matcher(commit).matches())
if (commit == null || !COMMIT_TEST.matcher(commit).matches())
{
throw PluginBuildException.of(internalName, "commit must be a full 40 character sha1sum")
.withFileLine(pluginCommitDescriptor, "commit=" + commit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ public void testInternalNameChecks() throws IOException, DisabledPluginException
}
}

@Test
public void testCommitIsRequired() throws DisabledPluginException, IOException
{
try
{
newPlugin("test", "" +
"repository=https://github.com/runelite/example-plugin.git\n");
Assert.fail();
}
catch (PluginBuildException e)
{
log.info("ok: ", e);
assertContains(e.getMessage(), "commit must be a full 40 character sha1sum");
assertContains(e.getHelpText(), "commit=null");
}
}

@Test
public void testCommitMustBeComplete() throws DisabledPluginException, IOException
{
Expand Down
3 changes: 3 additions & 0 deletions plugins/grand-flip-out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
repository=https://github.com/Tunatroll/grand-flip-out.git
commit=1d2649de4cb8cdac32a771b6e6fcb9396e32fdc1
warning=This plugin submits your IP address to a 3rd-party server not controlled or verified by RuneLite developers.