Fix C6011: dereferencing NULL pointer with_data (and external_data) (#12982)
Fix C6011: dereferencing NULL pointer with_data (and external_data) (#12982)

As title. For pattern like
```cpp
foo(*ptr)
```

we change them to
```cpp
if (ptr)
  foo(*ptr)
else
  throw
```
microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime