Sometimes getResourcePath() would return null which caused a NullPointer...

...Exception