fix NPE on MethodFormat.getCodeSource

When use a custom classloader `﻿﻿protectionDomain.getCodeSource().getLocation()` can return null.