1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-15 12:29:26 +01:00

Fix NPE when replacing unexisting strings

This commit is contained in:
Martino Facchin 2016-01-25 18:29:25 +01:00
parent 6d5597b070
commit c11ceb7dae

View File

@ -94,8 +94,10 @@ public class StringReplacer {
String rightDelimiter) { String rightDelimiter) {
for (Map.Entry<String, String> entry : map.entrySet()) { for (Map.Entry<String, String> entry : map.entrySet()) {
String keyword = leftDelimiter + entry.getKey() + rightDelimiter; String keyword = leftDelimiter + entry.getKey() + rightDelimiter;
if (entry.getValue() != null && keyword != null) {
src = src.replace(keyword, entry.getValue()); src = src.replace(keyword, entry.getValue());
} }
}
return src; return src;
} }