Skip to content

Commit

Permalink
[MSHADE-412] avoid possible NPE since rawString was added in SimpleRe…
Browse files Browse the repository at this point in the history
…locator (#123)
  • Loading branch information
rmannibucau committed Mar 17, 2022
1 parent 04afab6 commit 17b87aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -242,7 +242,7 @@ public String relocatePath( String path )

public String relocateClass( String clazz )
{
return clazz.replaceFirst( pattern, shadedPattern );
return rawString ? clazz : clazz.replaceFirst( pattern, shadedPattern );
}

public String applyToSourceContent( String sourceContent )
Expand Down
Expand Up @@ -38,6 +38,12 @@
public class SimpleRelocatorTest
{

@Test
public void testNoNpeRelocateClass()
{
new SimpleRelocator( "foo", "bar", null, null, true ).relocateClass( "foo" );
}

@Test
public void testCanRelocatePath()
{
Expand Down

0 comments on commit 17b87aa

Please sign in to comment.